id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,400 | juju/juju | state/volume.go | PlanInfo | func (v *volumeAttachmentPlan) PlanInfo() (VolumeAttachmentPlanInfo, error) {
if v.doc.PlanInfo == nil {
return VolumeAttachmentPlanInfo{}, errors.NotProvisionedf("volume attachment plan %q on %q", v.doc.Volume, v.doc.Machine)
}
return *v.doc.PlanInfo, nil
} | go | func (v *volumeAttachmentPlan) PlanInfo() (VolumeAttachmentPlanInfo, error) {
if v.doc.PlanInfo == nil {
return VolumeAttachmentPlanInfo{}, errors.NotProvisionedf("volume attachment plan %q on %q", v.doc.Volume, v.doc.Machine)
}
return *v.doc.PlanInfo, nil
} | [
"func",
"(",
"v",
"*",
"volumeAttachmentPlan",
")",
"PlanInfo",
"(",
")",
"(",
"VolumeAttachmentPlanInfo",
",",
"error",
")",
"{",
"if",
"v",
".",
"doc",
".",
"PlanInfo",
"==",
"nil",
"{",
"return",
"VolumeAttachmentPlanInfo",
"{",
"}",
",",
"errors",
".",... | // PlanInfo is required to implement VolumeAttachment. | [
"PlanInfo",
"is",
"required",
"to",
"implement",
"VolumeAttachment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L335-L340 |
3,401 | juju/juju | state/volume.go | Volume | func (v *volumeAttachment) Volume() names.VolumeTag {
return names.NewVolumeTag(v.doc.Volume)
} | go | func (v *volumeAttachment) Volume() names.VolumeTag {
return names.NewVolumeTag(v.doc.Volume)
} | [
"func",
"(",
"v",
"*",
"volumeAttachment",
")",
"Volume",
"(",
")",
"names",
".",
"VolumeTag",
"{",
"return",
"names",
".",
"NewVolumeTag",
"(",
"v",
".",
"doc",
".",
"Volume",
")",
"\n",
"}"
] | // Volume is required to implement VolumeAttachment. | [
"Volume",
"is",
"required",
"to",
"implement",
"VolumeAttachment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L350-L352 |
3,402 | juju/juju | state/volume.go | Info | func (v *volumeAttachment) Info() (VolumeAttachmentInfo, error) {
if v.doc.Info == nil {
host := storageAttachmentHost(v.doc.Host)
return VolumeAttachmentInfo{}, errors.NotProvisionedf("volume attachment %q on %q", v.doc.Volume, names.ReadableString(host))
}
return *v.doc.Info, nil
} | go | func (v *volumeAttachment) Info() (VolumeAttachmentInfo, error) {
if v.doc.Info == nil {
host := storageAttachmentHost(v.doc.Host)
return VolumeAttachmentInfo{}, errors.NotProvisionedf("volume attachment %q on %q", v.doc.Volume, names.ReadableString(host))
}
return *v.doc.Info, nil
} | [
"func",
"(",
"v",
"*",
"volumeAttachment",
")",
"Info",
"(",
")",
"(",
"VolumeAttachmentInfo",
",",
"error",
")",
"{",
"if",
"v",
".",
"doc",
".",
"Info",
"==",
"nil",
"{",
"host",
":=",
"storageAttachmentHost",
"(",
"v",
".",
"doc",
".",
"Host",
")"... | // Info is required to implement VolumeAttachment. | [
"Info",
"is",
"required",
"to",
"implement",
"VolumeAttachment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L365-L371 |
3,403 | juju/juju | state/volume.go | Params | func (v *volumeAttachment) Params() (VolumeAttachmentParams, bool) {
if v.doc.Params == nil {
return VolumeAttachmentParams{}, false
}
return *v.doc.Params, true
} | go | func (v *volumeAttachment) Params() (VolumeAttachmentParams, bool) {
if v.doc.Params == nil {
return VolumeAttachmentParams{}, false
}
return *v.doc.Params, true
} | [
"func",
"(",
"v",
"*",
"volumeAttachment",
")",
"Params",
"(",
")",
"(",
"VolumeAttachmentParams",
",",
"bool",
")",
"{",
"if",
"v",
".",
"doc",
".",
"Params",
"==",
"nil",
"{",
"return",
"VolumeAttachmentParams",
"{",
"}",
",",
"false",
"\n",
"}",
"\n... | // Params is required to implement VolumeAttachment. | [
"Params",
"is",
"required",
"to",
"implement",
"VolumeAttachment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L374-L379 |
3,404 | juju/juju | state/volume.go | Volume | func (sb *storageBackend) Volume(tag names.VolumeTag) (Volume, error) {
v, err := getVolumeByTag(sb.mb, tag)
return v, err
} | go | func (sb *storageBackend) Volume(tag names.VolumeTag) (Volume, error) {
v, err := getVolumeByTag(sb.mb, tag)
return v, err
} | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"Volume",
"(",
"tag",
"names",
".",
"VolumeTag",
")",
"(",
"Volume",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"getVolumeByTag",
"(",
"sb",
".",
"mb",
",",
"tag",
")",
"\n",
"return",
"v",
",",
... | // Volume returns the Volume with the specified name. | [
"Volume",
"returns",
"the",
"Volume",
"with",
"the",
"specified",
"name",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L382-L385 |
3,405 | juju/juju | state/volume.go | StorageInstanceVolume | func (sb *storageBackend) StorageInstanceVolume(tag names.StorageTag) (Volume, error) {
v, err := sb.storageInstanceVolume(tag)
return v, err
} | go | func (sb *storageBackend) StorageInstanceVolume(tag names.StorageTag) (Volume, error) {
v, err := sb.storageInstanceVolume(tag)
return v, err
} | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"StorageInstanceVolume",
"(",
"tag",
"names",
".",
"StorageTag",
")",
"(",
"Volume",
",",
"error",
")",
"{",
"v",
",",
"err",
":=",
"sb",
".",
"storageInstanceVolume",
"(",
"tag",
")",
"\n",
"return",
"v",
... | // StorageInstanceVolume returns the Volume assigned to the specified
// storage instance. | [
"StorageInstanceVolume",
"returns",
"the",
"Volume",
"assigned",
"to",
"the",
"specified",
"storage",
"instance",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L466-L469 |
3,406 | juju/juju | state/volume.go | VolumeAttachment | func (sb *storageBackend) VolumeAttachment(host names.Tag, volume names.VolumeTag) (VolumeAttachment, error) {
coll, cleanup := sb.mb.db().GetCollection(volumeAttachmentsC)
defer cleanup()
var att volumeAttachment
err := coll.FindId(volumeAttachmentId(host.Id(), volume.Id())).One(&att.doc)
if err == mgo.ErrNotFou... | go | func (sb *storageBackend) VolumeAttachment(host names.Tag, volume names.VolumeTag) (VolumeAttachment, error) {
coll, cleanup := sb.mb.db().GetCollection(volumeAttachmentsC)
defer cleanup()
var att volumeAttachment
err := coll.FindId(volumeAttachmentId(host.Id(), volume.Id())).One(&att.doc)
if err == mgo.ErrNotFou... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"VolumeAttachment",
"(",
"host",
"names",
".",
"Tag",
",",
"volume",
"names",
".",
"VolumeTag",
")",
"(",
"VolumeAttachment",
",",
"error",
")",
"{",
"coll",
",",
"cleanup",
":=",
"sb",
".",
"mb",
".",
"db... | // VolumeAttachment returns the VolumeAttachment corresponding to
// the specified volume and machine. | [
"VolumeAttachment",
"returns",
"the",
"VolumeAttachment",
"corresponding",
"to",
"the",
"specified",
"volume",
"and",
"machine",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L473-L485 |
3,407 | juju/juju | state/volume.go | MachineVolumeAttachments | func (sb *storageBackend) MachineVolumeAttachments(machine names.MachineTag) ([]VolumeAttachment, error) {
attachments, err := sb.volumeAttachments(bson.D{{"hostid", machine.Id()}})
if err != nil {
return nil, errors.Annotatef(err, "getting volume attachments for machine %q", machine.Id())
}
return attachments, n... | go | func (sb *storageBackend) MachineVolumeAttachments(machine names.MachineTag) ([]VolumeAttachment, error) {
attachments, err := sb.volumeAttachments(bson.D{{"hostid", machine.Id()}})
if err != nil {
return nil, errors.Annotatef(err, "getting volume attachments for machine %q", machine.Id())
}
return attachments, n... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"MachineVolumeAttachments",
"(",
"machine",
"names",
".",
"MachineTag",
")",
"(",
"[",
"]",
"VolumeAttachment",
",",
"error",
")",
"{",
"attachments",
",",
"err",
":=",
"sb",
".",
"volumeAttachments",
"(",
"bson... | // MachineVolumeAttachments returns all of the VolumeAttachments for the
// specified machine. | [
"MachineVolumeAttachments",
"returns",
"all",
"of",
"the",
"VolumeAttachments",
"for",
"the",
"specified",
"machine",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L503-L509 |
3,408 | juju/juju | state/volume.go | UnitVolumeAttachments | func (sb *storageBackend) UnitVolumeAttachments(unit names.UnitTag) ([]VolumeAttachment, error) {
attachments, err := sb.volumeAttachments(bson.D{{"hostid", unit.Id()}})
if err != nil {
return nil, errors.Annotatef(err, "getting volume attachments for unit %q", unit.Id())
}
return attachments, nil
} | go | func (sb *storageBackend) UnitVolumeAttachments(unit names.UnitTag) ([]VolumeAttachment, error) {
attachments, err := sb.volumeAttachments(bson.D{{"hostid", unit.Id()}})
if err != nil {
return nil, errors.Annotatef(err, "getting volume attachments for unit %q", unit.Id())
}
return attachments, nil
} | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"UnitVolumeAttachments",
"(",
"unit",
"names",
".",
"UnitTag",
")",
"(",
"[",
"]",
"VolumeAttachment",
",",
"error",
")",
"{",
"attachments",
",",
"err",
":=",
"sb",
".",
"volumeAttachments",
"(",
"bson",
".",... | // UnitVolumeAttachments returns all of the VolumeAttachments for the
// specified unit. | [
"UnitVolumeAttachments",
"returns",
"all",
"of",
"the",
"VolumeAttachments",
"for",
"the",
"specified",
"unit",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L513-L519 |
3,409 | juju/juju | state/volume.go | VolumeAttachments | func (sb *storageBackend) VolumeAttachments(volume names.VolumeTag) ([]VolumeAttachment, error) {
attachments, err := sb.volumeAttachments(bson.D{{"volumeid", volume.Id()}})
if err != nil {
return nil, errors.Annotatef(err, "getting volume attachments for volume %q", volume.Id())
}
return attachments, nil
} | go | func (sb *storageBackend) VolumeAttachments(volume names.VolumeTag) ([]VolumeAttachment, error) {
attachments, err := sb.volumeAttachments(bson.D{{"volumeid", volume.Id()}})
if err != nil {
return nil, errors.Annotatef(err, "getting volume attachments for volume %q", volume.Id())
}
return attachments, nil
} | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"VolumeAttachments",
"(",
"volume",
"names",
".",
"VolumeTag",
")",
"(",
"[",
"]",
"VolumeAttachment",
",",
"error",
")",
"{",
"attachments",
",",
"err",
":=",
"sb",
".",
"volumeAttachments",
"(",
"bson",
".",... | // VolumeAttachments returns all of the VolumeAttachments for the specified
// volume. | [
"VolumeAttachments",
"returns",
"all",
"of",
"the",
"VolumeAttachments",
"for",
"the",
"specified",
"volume",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L523-L529 |
3,410 | juju/juju | state/volume.go | VolumeAttachmentPlans | func (sb *storageBackend) VolumeAttachmentPlans(volume names.VolumeTag) ([]VolumeAttachmentPlan, error) {
attachmentPlans, err := sb.volumeAttachmentPlans(bson.D{{"volumeid", volume.Id()}})
if err != nil {
return nil, errors.Annotatef(err, "getting volume attachment plans for volume %q", volume.Id())
}
return att... | go | func (sb *storageBackend) VolumeAttachmentPlans(volume names.VolumeTag) ([]VolumeAttachmentPlan, error) {
attachmentPlans, err := sb.volumeAttachmentPlans(bson.D{{"volumeid", volume.Id()}})
if err != nil {
return nil, errors.Annotatef(err, "getting volume attachment plans for volume %q", volume.Id())
}
return att... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"VolumeAttachmentPlans",
"(",
"volume",
"names",
".",
"VolumeTag",
")",
"(",
"[",
"]",
"VolumeAttachmentPlan",
",",
"error",
")",
"{",
"attachmentPlans",
",",
"err",
":=",
"sb",
".",
"volumeAttachmentPlans",
"(",
... | // VolumeAttachmentPlans returns all of the VolumeAttachmentPlans for the specified
// volume. | [
"VolumeAttachmentPlans",
"returns",
"all",
"of",
"the",
"VolumeAttachmentPlans",
"for",
"the",
"specified",
"volume",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L560-L566 |
3,411 | juju/juju | state/volume.go | removeMachineVolumesOps | func (sb *storageBackend) removeMachineVolumesOps(m *Machine) ([]txn.Op, error) {
// A machine cannot transition to Dead if it has any detachable storage
// attached, so any attachments are for machine-bound storage.
//
// Even if a volume is "non-detachable", there still exist volume
// attachments, and they may ... | go | func (sb *storageBackend) removeMachineVolumesOps(m *Machine) ([]txn.Op, error) {
// A machine cannot transition to Dead if it has any detachable storage
// attached, so any attachments are for machine-bound storage.
//
// Even if a volume is "non-detachable", there still exist volume
// attachments, and they may ... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"removeMachineVolumesOps",
"(",
"m",
"*",
"Machine",
")",
"(",
"[",
"]",
"txn",
".",
"Op",
",",
"error",
")",
"{",
"// A machine cannot transition to Dead if it has any detachable storage",
"// attached, so any attachments ... | // removeMachineVolumesOps returns txn.Ops to remove non-persistent volumes
// bound or attached to the specified machine. This is used when the given
// machine is being removed from state. | [
"removeMachineVolumesOps",
"returns",
"txn",
".",
"Ops",
"to",
"remove",
"non",
"-",
"persistent",
"volumes",
"bound",
"or",
"attached",
"to",
"the",
"specified",
"machine",
".",
"This",
"is",
"used",
"when",
"the",
"given",
"machine",
"is",
"being",
"removed"... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L598-L644 |
3,412 | juju/juju | state/volume.go | isDetachableVolumeTag | func isDetachableVolumeTag(db Database, tag names.VolumeTag) (bool, error) {
doc, err := getVolumeDocByTag(db, tag)
if err != nil {
return false, errors.Trace(err)
}
return detachableVolumeDoc(&doc), nil
} | go | func isDetachableVolumeTag(db Database, tag names.VolumeTag) (bool, error) {
doc, err := getVolumeDocByTag(db, tag)
if err != nil {
return false, errors.Trace(err)
}
return detachableVolumeDoc(&doc), nil
} | [
"func",
"isDetachableVolumeTag",
"(",
"db",
"Database",
",",
"tag",
"names",
".",
"VolumeTag",
")",
"(",
"bool",
",",
"error",
")",
"{",
"doc",
",",
"err",
":=",
"getVolumeDocByTag",
"(",
"db",
",",
"tag",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"r... | // isDetachableVolumeTag reports whether or not the volume with the specified
// tag is detachable. | [
"isDetachableVolumeTag",
"reports",
"whether",
"or",
"not",
"the",
"volume",
"with",
"the",
"specified",
"tag",
"is",
"detachable",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L648-L654 |
3,413 | juju/juju | state/volume.go | isDetachableVolumePool | func isDetachableVolumePool(im *storageBackend, pool string) (bool, error) {
_, provider, _, err := poolStorageProvider(im, pool)
if err != nil {
return false, errors.Trace(err)
}
if provider.Scope() == storage.ScopeMachine {
// Any storage created by a machine cannot be detached from
// the machine, and must... | go | func isDetachableVolumePool(im *storageBackend, pool string) (bool, error) {
_, provider, _, err := poolStorageProvider(im, pool)
if err != nil {
return false, errors.Trace(err)
}
if provider.Scope() == storage.ScopeMachine {
// Any storage created by a machine cannot be detached from
// the machine, and must... | [
"func",
"isDetachableVolumePool",
"(",
"im",
"*",
"storageBackend",
",",
"pool",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"_",
",",
"provider",
",",
"_",
",",
"err",
":=",
"poolStorageProvider",
"(",
"im",
",",
"pool",
")",
"\n",
"if",
"err"... | // isDetachableVolumePool reports whether or not the given storage
// pool will create a volume that is not inherently bound to a machine,
// and therefore can be detached. | [
"isDetachableVolumePool",
"reports",
"whether",
"or",
"not",
"the",
"given",
"storage",
"pool",
"will",
"create",
"a",
"volume",
"that",
"is",
"not",
"inherently",
"bound",
"to",
"a",
"machine",
"and",
"therefore",
"can",
"be",
"detached",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L675-L699 |
3,414 | juju/juju | state/volume.go | DetachVolume | func (sb *storageBackend) DetachVolume(host names.Tag, volume names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "detaching volume %s from %s", volume.Id(), names.ReadableString(host))
// If the volume is backing a filesystem, the volume cannot be detached
// until the filesystem has been detached.
... | go | func (sb *storageBackend) DetachVolume(host names.Tag, volume names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "detaching volume %s from %s", volume.Id(), names.ReadableString(host))
// If the volume is backing a filesystem, the volume cannot be detached
// until the filesystem has been detached.
... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"DetachVolume",
"(",
"host",
"names",
".",
"Tag",
",",
"volume",
"names",
".",
"VolumeTag",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"errors",
".",
"DeferredAnnotatef",
"(",
"&",
"err",
",",
"\"",
"\""... | // DetachVolume marks the volume attachment identified by the specified machine
// and volume tags as Dying, if it is Alive. DetachVolume will fail with a
// IsContainsFilesystem error if the volume contains an attached filesystem; the
// filesystem attachment must be removed first. DetachVolume will fail for
// inhere... | [
"DetachVolume",
"marks",
"the",
"volume",
"attachment",
"identified",
"by",
"the",
"specified",
"machine",
"and",
"volume",
"tags",
"as",
"Dying",
"if",
"it",
"is",
"Alive",
".",
"DetachVolume",
"will",
"fail",
"with",
"a",
"IsContainsFilesystem",
"error",
"if",... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L706-L740 |
3,415 | juju/juju | state/volume.go | RemoveVolumeAttachment | func (sb *storageBackend) RemoveVolumeAttachment(host names.Tag, volume names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "removing attachment of volume %s from %s", volume.Id(), names.ReadableString(host))
buildTxn := func(attempt int) ([]txn.Op, error) {
attachment, err := sb.VolumeAttachment(ho... | go | func (sb *storageBackend) RemoveVolumeAttachment(host names.Tag, volume names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "removing attachment of volume %s from %s", volume.Id(), names.ReadableString(host))
buildTxn := func(attempt int) ([]txn.Op, error) {
attachment, err := sb.VolumeAttachment(ho... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"RemoveVolumeAttachment",
"(",
"host",
"names",
".",
"Tag",
",",
"volume",
"names",
".",
"VolumeTag",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"errors",
".",
"DeferredAnnotatef",
"(",
"&",
"err",
",",
"\... | // RemoveVolumeAttachment removes the volume attachment from state.
// RemoveVolumeAttachment will fail if the attachment is not Dying. | [
"RemoveVolumeAttachment",
"removes",
"the",
"volume",
"attachment",
"from",
"state",
".",
"RemoveVolumeAttachment",
"will",
"fail",
"if",
"the",
"attachment",
"is",
"not",
"Dying",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L771-L794 |
3,416 | juju/juju | state/volume.go | DestroyVolume | func (sb *storageBackend) DestroyVolume(tag names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "destroying volume %s", tag.Id())
if _, err := sb.VolumeFilesystem(tag); err == nil {
return &errContainsFilesystem{errors.New("volume contains filesystem")}
} else if !errors.IsNotFound(err) {
return ... | go | func (sb *storageBackend) DestroyVolume(tag names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "destroying volume %s", tag.Id())
if _, err := sb.VolumeFilesystem(tag); err == nil {
return &errContainsFilesystem{errors.New("volume contains filesystem")}
} else if !errors.IsNotFound(err) {
return ... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"DestroyVolume",
"(",
"tag",
"names",
".",
"VolumeTag",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"errors",
".",
"DeferredAnnotatef",
"(",
"&",
"err",
",",
"\"",
"\"",
",",
"tag",
".",
"Id",
"(",
")",... | // DestroyVolume ensures that the volume and any attachments to it will be
// destroyed and removed from state at some point in the future. DestroyVolume
// will fail with an IsContainsFilesystem error if the volume contains a
// filesystem; the filesystem must be fully removed first. | [
"DestroyVolume",
"ensures",
"that",
"the",
"volume",
"and",
"any",
"attachments",
"to",
"it",
"will",
"be",
"destroyed",
"and",
"removed",
"from",
"state",
"at",
"some",
"point",
"in",
"the",
"future",
".",
"DestroyVolume",
"will",
"fail",
"with",
"an",
"IsC... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L875-L906 |
3,417 | juju/juju | state/volume.go | RemoveVolume | func (sb *storageBackend) RemoveVolume(tag names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "removing volume %s", tag.Id())
buildTxn := func(attempt int) ([]txn.Op, error) {
volume, err := sb.Volume(tag)
if errors.IsNotFound(err) {
return nil, jujutxn.ErrNoOperations
} else if err != nil {... | go | func (sb *storageBackend) RemoveVolume(tag names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "removing volume %s", tag.Id())
buildTxn := func(attempt int) ([]txn.Op, error) {
volume, err := sb.Volume(tag)
if errors.IsNotFound(err) {
return nil, jujutxn.ErrNoOperations
} else if err != nil {... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"RemoveVolume",
"(",
"tag",
"names",
".",
"VolumeTag",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"errors",
".",
"DeferredAnnotatef",
"(",
"&",
"err",
",",
"\"",
"\"",
",",
"tag",
".",
"Id",
"(",
")",
... | // RemoveVolume removes the volume from state. RemoveVolume will fail if
// the volume is not Dead, which implies that it still has attachments. | [
"RemoveVolume",
"removes",
"the",
"volume",
"from",
"state",
".",
"RemoveVolume",
"will",
"fail",
"if",
"the",
"volume",
"is",
"not",
"Dead",
"which",
"implies",
"that",
"it",
"still",
"has",
"attachments",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L964-L979 |
3,418 | juju/juju | state/volume.go | addVolumeOps | func (sb *storageBackend) addVolumeOps(params VolumeParams, hostId string) ([]txn.Op, names.VolumeTag, error) {
params, err := sb.volumeParamsWithDefaults(params)
if err != nil {
return nil, names.VolumeTag{}, errors.Trace(err)
}
detachable, err := isDetachableVolumePool(sb, params.Pool)
if err != nil {
return... | go | func (sb *storageBackend) addVolumeOps(params VolumeParams, hostId string) ([]txn.Op, names.VolumeTag, error) {
params, err := sb.volumeParamsWithDefaults(params)
if err != nil {
return nil, names.VolumeTag{}, errors.Trace(err)
}
detachable, err := isDetachableVolumePool(sb, params.Pool)
if err != nil {
return... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"addVolumeOps",
"(",
"params",
"VolumeParams",
",",
"hostId",
"string",
")",
"(",
"[",
"]",
"txn",
".",
"Op",
",",
"names",
".",
"VolumeTag",
",",
"error",
")",
"{",
"params",
",",
"err",
":=",
"sb",
"."... | // addVolumeOps returns txn.Ops to create a new volume with the specified
// parameters. If the supplied host ID is non-empty, and the storage
// provider is machine-scoped, then the volume will be scoped to that
// machine. | [
"addVolumeOps",
"returns",
"txn",
".",
"Ops",
"to",
"create",
"a",
"new",
"volume",
"with",
"the",
"specified",
"parameters",
".",
"If",
"the",
"supplied",
"host",
"ID",
"is",
"non",
"-",
"empty",
"and",
"the",
"storage",
"provider",
"is",
"machine",
"-",
... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1014-L1055 |
3,419 | juju/juju | state/volume.go | validateVolumeParams | func (sb *storageBackend) validateVolumeParams(params VolumeParams, machineId string) (maybeMachineId string, _ error) {
if err := validateStoragePool(sb, params.Pool, storage.StorageKindBlock, &machineId); err != nil {
return "", err
}
if params.Size == 0 {
return "", errors.New("invalid size 0")
}
return mac... | go | func (sb *storageBackend) validateVolumeParams(params VolumeParams, machineId string) (maybeMachineId string, _ error) {
if err := validateStoragePool(sb, params.Pool, storage.StorageKindBlock, &machineId); err != nil {
return "", err
}
if params.Size == 0 {
return "", errors.New("invalid size 0")
}
return mac... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"validateVolumeParams",
"(",
"params",
"VolumeParams",
",",
"machineId",
"string",
")",
"(",
"maybeMachineId",
"string",
",",
"_",
"error",
")",
"{",
"if",
"err",
":=",
"validateStoragePool",
"(",
"sb",
",",
"pa... | // validateVolumeParams validates the volume parameters, and returns the
// machine ID to use as the scope in the volume tag. | [
"validateVolumeParams",
"validates",
"the",
"volume",
"parameters",
"and",
"returns",
"the",
"machine",
"ID",
"to",
"use",
"as",
"the",
"scope",
"in",
"the",
"volume",
"tag",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1092-L1100 |
3,420 | juju/juju | state/volume.go | ParseVolumeAttachmentId | func ParseVolumeAttachmentId(id string) (names.Tag, names.VolumeTag, error) {
fields := strings.SplitN(id, ":", 2)
isValidHost := names.IsValidMachine(fields[0]) || names.IsValidUnit(fields[0])
if len(fields) != 2 || !isValidHost || !names.IsValidVolume(fields[1]) {
return names.MachineTag{}, names.VolumeTag{}, er... | go | func ParseVolumeAttachmentId(id string) (names.Tag, names.VolumeTag, error) {
fields := strings.SplitN(id, ":", 2)
isValidHost := names.IsValidMachine(fields[0]) || names.IsValidUnit(fields[0])
if len(fields) != 2 || !isValidHost || !names.IsValidVolume(fields[1]) {
return names.MachineTag{}, names.VolumeTag{}, er... | [
"func",
"ParseVolumeAttachmentId",
"(",
"id",
"string",
")",
"(",
"names",
".",
"Tag",
",",
"names",
".",
"VolumeTag",
",",
"error",
")",
"{",
"fields",
":=",
"strings",
".",
"SplitN",
"(",
"id",
",",
"\"",
"\"",
",",
"2",
")",
"\n",
"isValidHost",
"... | // ParseVolumeAttachmentId parses a string as a volume attachment ID,
// returning the host and volume components. | [
"ParseVolumeAttachmentId",
"parses",
"a",
"string",
"as",
"a",
"volume",
"attachment",
"ID",
"returning",
"the",
"host",
"and",
"volume",
"components",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1110-L1124 |
3,421 | juju/juju | state/volume.go | createMachineVolumeAttachmentsOps | func createMachineVolumeAttachmentsOps(hostId string, attachments []volumeAttachmentTemplate) []txn.Op {
ops := make([]txn.Op, len(attachments))
for i, attachment := range attachments {
paramsCopy := attachment.params
ops[i] = txn.Op{
C: volumeAttachmentsC,
Id: volumeAttachmentId(hostId, attachment... | go | func createMachineVolumeAttachmentsOps(hostId string, attachments []volumeAttachmentTemplate) []txn.Op {
ops := make([]txn.Op, len(attachments))
for i, attachment := range attachments {
paramsCopy := attachment.params
ops[i] = txn.Op{
C: volumeAttachmentsC,
Id: volumeAttachmentId(hostId, attachment... | [
"func",
"createMachineVolumeAttachmentsOps",
"(",
"hostId",
"string",
",",
"attachments",
"[",
"]",
"volumeAttachmentTemplate",
")",
"[",
"]",
"txn",
".",
"Op",
"{",
"ops",
":=",
"make",
"(",
"[",
"]",
"txn",
".",
"Op",
",",
"len",
"(",
"attachments",
")",... | // createMachineVolumeAttachmentInfo creates volume attachments
// for the specified host, and attachment parameters keyed
// by volume tags. The caller is responsible for incrementing
// the volume's attachmentcount field. | [
"createMachineVolumeAttachmentInfo",
"creates",
"volume",
"attachments",
"for",
"the",
"specified",
"host",
"and",
"attachment",
"parameters",
"keyed",
"by",
"volume",
"tags",
".",
"The",
"caller",
"is",
"responsible",
"for",
"incrementing",
"the",
"volume",
"s",
"a... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1136-L1160 |
3,422 | juju/juju | state/volume.go | setMachineVolumeAttachmentInfo | func setMachineVolumeAttachmentInfo(sb *storageBackend, machineId string, attachments map[names.VolumeTag]VolumeAttachmentInfo) (err error) {
defer errors.DeferredAnnotatef(&err, "cannot set volume attachment info for machine %s", machineId)
machineTag := names.NewMachineTag(machineId)
for volumeTag, info := range a... | go | func setMachineVolumeAttachmentInfo(sb *storageBackend, machineId string, attachments map[names.VolumeTag]VolumeAttachmentInfo) (err error) {
defer errors.DeferredAnnotatef(&err, "cannot set volume attachment info for machine %s", machineId)
machineTag := names.NewMachineTag(machineId)
for volumeTag, info := range a... | [
"func",
"setMachineVolumeAttachmentInfo",
"(",
"sb",
"*",
"storageBackend",
",",
"machineId",
"string",
",",
"attachments",
"map",
"[",
"names",
".",
"VolumeTag",
"]",
"VolumeAttachmentInfo",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"errors",
".",
"DeferredA... | // setMachineVolumeAttachmentInfo sets the volume attachment
// info for the specified machine. Each volume attachment info
// structure is keyed by the name of the volume it corresponds
// to. | [
"setMachineVolumeAttachmentInfo",
"sets",
"the",
"volume",
"attachment",
"info",
"for",
"the",
"specified",
"machine",
".",
"Each",
"volume",
"attachment",
"info",
"structure",
"is",
"keyed",
"by",
"the",
"name",
"of",
"the",
"volume",
"it",
"corresponds",
"to",
... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1166-L1175 |
3,423 | juju/juju | state/volume.go | SetVolumeAttachmentInfo | func (sb *storageBackend) SetVolumeAttachmentInfo(hostTag names.Tag, volumeTag names.VolumeTag, info VolumeAttachmentInfo) (err error) {
defer errors.DeferredAnnotatef(&err, "cannot set info for volume attachment %s:%s", volumeTag.Id(), hostTag.Id())
v, err := sb.Volume(volumeTag)
if err != nil {
return errors.Tra... | go | func (sb *storageBackend) SetVolumeAttachmentInfo(hostTag names.Tag, volumeTag names.VolumeTag, info VolumeAttachmentInfo) (err error) {
defer errors.DeferredAnnotatef(&err, "cannot set info for volume attachment %s:%s", volumeTag.Id(), hostTag.Id())
v, err := sb.Volume(volumeTag)
if err != nil {
return errors.Tra... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"SetVolumeAttachmentInfo",
"(",
"hostTag",
"names",
".",
"Tag",
",",
"volumeTag",
"names",
".",
"VolumeTag",
",",
"info",
"VolumeAttachmentInfo",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"errors",
".",
"Defe... | // SetVolumeAttachmentInfo sets the VolumeAttachmentInfo for the specified
// volume attachment. | [
"SetVolumeAttachmentInfo",
"sets",
"the",
"VolumeAttachmentInfo",
"for",
"the",
"specified",
"volume",
"attachment",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1179-L1202 |
3,424 | juju/juju | state/volume.go | RemoveVolumeAttachmentPlan | func (sb *storageBackend) RemoveVolumeAttachmentPlan(hostTag names.Tag, volume names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "removing attachment plan of volume %s from machine %s", volume.Id(), hostTag.Id())
buildTxn := func(attempt int) ([]txn.Op, error) {
plans, err := sb.machineVolumeAttac... | go | func (sb *storageBackend) RemoveVolumeAttachmentPlan(hostTag names.Tag, volume names.VolumeTag) (err error) {
defer errors.DeferredAnnotatef(&err, "removing attachment plan of volume %s from machine %s", volume.Id(), hostTag.Id())
buildTxn := func(attempt int) ([]txn.Op, error) {
plans, err := sb.machineVolumeAttac... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"RemoveVolumeAttachmentPlan",
"(",
"hostTag",
"names",
".",
"Tag",
",",
"volume",
"names",
".",
"VolumeTag",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"errors",
".",
"DeferredAnnotatef",
"(",
"&",
"err",
",... | // RemoveVolumeAttachmentPlan removes the volume attachment plan from state. | [
"RemoveVolumeAttachmentPlan",
"removes",
"the",
"volume",
"attachment",
"plan",
"from",
"state",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1361-L1382 |
3,425 | juju/juju | state/volume.go | removeVolumeAttachmentPlanOps | func removeVolumeAttachmentPlanOps(hostTag names.Tag, volume names.VolumeTag) []txn.Op {
detachOps := detachVolumeOps(hostTag, volume)
removeOps := []txn.Op{{
C: volumeAttachmentPlanC,
Id: volumeAttachmentId(hostTag.Id(), volume.Id()),
Assert: bson.D{{"life", Dying}},
Remove: true,
}}
removeOps = a... | go | func removeVolumeAttachmentPlanOps(hostTag names.Tag, volume names.VolumeTag) []txn.Op {
detachOps := detachVolumeOps(hostTag, volume)
removeOps := []txn.Op{{
C: volumeAttachmentPlanC,
Id: volumeAttachmentId(hostTag.Id(), volume.Id()),
Assert: bson.D{{"life", Dying}},
Remove: true,
}}
removeOps = a... | [
"func",
"removeVolumeAttachmentPlanOps",
"(",
"hostTag",
"names",
".",
"Tag",
",",
"volume",
"names",
".",
"VolumeTag",
")",
"[",
"]",
"txn",
".",
"Op",
"{",
"detachOps",
":=",
"detachVolumeOps",
"(",
"hostTag",
",",
"volume",
")",
"\n",
"removeOps",
":=",
... | // removeVolumeAttachmentPlanOps removes the plan from state and sets the volume attachment to Dying.
// this will trigger the storageprovisioner on the controller to eventually detach the volume from
// the machine. | [
"removeVolumeAttachmentPlanOps",
"removes",
"the",
"plan",
"from",
"state",
"and",
"sets",
"the",
"volume",
"attachment",
"to",
"Dying",
".",
"this",
"will",
"trigger",
"the",
"storageprovisioner",
"on",
"the",
"controller",
"to",
"eventually",
"detach",
"the",
"v... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1387-L1397 |
3,426 | juju/juju | state/volume.go | setProvisionedVolumeInfo | func setProvisionedVolumeInfo(sb *storageBackend, volumes map[names.VolumeTag]VolumeInfo) error {
for volumeTag, info := range volumes {
if err := sb.SetVolumeInfo(volumeTag, info); err != nil {
return errors.Trace(err)
}
}
return nil
} | go | func setProvisionedVolumeInfo(sb *storageBackend, volumes map[names.VolumeTag]VolumeInfo) error {
for volumeTag, info := range volumes {
if err := sb.SetVolumeInfo(volumeTag, info); err != nil {
return errors.Trace(err)
}
}
return nil
} | [
"func",
"setProvisionedVolumeInfo",
"(",
"sb",
"*",
"storageBackend",
",",
"volumes",
"map",
"[",
"names",
".",
"VolumeTag",
"]",
"VolumeInfo",
")",
"error",
"{",
"for",
"volumeTag",
",",
"info",
":=",
"range",
"volumes",
"{",
"if",
"err",
":=",
"sb",
".",... | // setProvisionedVolumeInfo sets the initial info for newly
// provisioned volumes. If non-empty, machineId must be the
// machine ID associated with the volumes. | [
"setProvisionedVolumeInfo",
"sets",
"the",
"initial",
"info",
"for",
"newly",
"provisioned",
"volumes",
".",
"If",
"non",
"-",
"empty",
"machineId",
"must",
"be",
"the",
"machine",
"ID",
"associated",
"with",
"the",
"volumes",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1402-L1409 |
3,427 | juju/juju | state/volume.go | SetVolumeInfo | func (sb *storageBackend) SetVolumeInfo(tag names.VolumeTag, info VolumeInfo) (err error) {
defer errors.DeferredAnnotatef(&err, "cannot set info for volume %q", tag.Id())
if info.VolumeId == "" {
return errors.New("volume ID not set")
}
// TODO(axw) we should reject info without VolumeId set; can't do this
// u... | go | func (sb *storageBackend) SetVolumeInfo(tag names.VolumeTag, info VolumeInfo) (err error) {
defer errors.DeferredAnnotatef(&err, "cannot set info for volume %q", tag.Id())
if info.VolumeId == "" {
return errors.New("volume ID not set")
}
// TODO(axw) we should reject info without VolumeId set; can't do this
// u... | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"SetVolumeInfo",
"(",
"tag",
"names",
".",
"VolumeTag",
",",
"info",
"VolumeInfo",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"errors",
".",
"DeferredAnnotatef",
"(",
"&",
"err",
",",
"\"",
"\"",
",",
"t... | // SetVolumeInfo sets the VolumeInfo for the specified volume. | [
"SetVolumeInfo",
"sets",
"the",
"VolumeInfo",
"for",
"the",
"specified",
"volume",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1412-L1446 |
3,428 | juju/juju | state/volume.go | AllVolumes | func (sb *storageBackend) AllVolumes() ([]Volume, error) {
volumes, err := sb.volumes(nil)
if err != nil {
return nil, errors.Annotate(err, "cannot get volumes")
}
return volumesToInterfaces(volumes), nil
} | go | func (sb *storageBackend) AllVolumes() ([]Volume, error) {
volumes, err := sb.volumes(nil)
if err != nil {
return nil, errors.Annotate(err, "cannot get volumes")
}
return volumesToInterfaces(volumes), nil
} | [
"func",
"(",
"sb",
"*",
"storageBackend",
")",
"AllVolumes",
"(",
")",
"(",
"[",
"]",
"Volume",
",",
"error",
")",
"{",
"volumes",
",",
"err",
":=",
"sb",
".",
"volumes",
"(",
"nil",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",... | // AllVolumes returns all Volumes scoped to the model. | [
"AllVolumes",
"returns",
"all",
"Volumes",
"scoped",
"to",
"the",
"model",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/volume.go#L1483-L1489 |
3,429 | juju/juju | worker/instancepoller/updater.go | watchMachinesLoop | func watchMachinesLoop(context updaterContext, machinesWatcher watcher.StringsWatcher) (err error) {
p := &updater{
context: context,
machines: make(map[names.MachineTag]chan struct{}),
machineDead: make(chan machine),
}
defer func() {
// TODO(fwereade): is this a home-grown sync.WaitGroup or somethin... | go | func watchMachinesLoop(context updaterContext, machinesWatcher watcher.StringsWatcher) (err error) {
p := &updater{
context: context,
machines: make(map[names.MachineTag]chan struct{}),
machineDead: make(chan machine),
}
defer func() {
// TODO(fwereade): is this a home-grown sync.WaitGroup or somethin... | [
"func",
"watchMachinesLoop",
"(",
"context",
"updaterContext",
",",
"machinesWatcher",
"watcher",
".",
"StringsWatcher",
")",
"(",
"err",
"error",
")",
"{",
"p",
":=",
"&",
"updater",
"{",
"context",
":",
"context",
",",
"machines",
":",
"make",
"(",
"map",
... | // watchMachinesLoop watches for changes provided by the given
// machinesWatcher and starts machine goroutines to deal with them,
// using the provided newMachineContext function to create the
// appropriate context for each new machine tag. | [
"watchMachinesLoop",
"watches",
"for",
"changes",
"provided",
"by",
"the",
"given",
"machinesWatcher",
"and",
"starts",
"machine",
"goroutines",
"to",
"deal",
"with",
"them",
"using",
"the",
"provided",
"newMachineContext",
"function",
"to",
"create",
"the",
"approp... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/instancepoller/updater.go#L86-L119 |
3,430 | juju/juju | worker/instancepoller/updater.go | runMachine | func runMachine(context machineContext, m machine, changed <-chan struct{}, died chan<- machine, clock clock.Clock) {
defer func() {
// We can't just send on the died channel because the
// central loop might be trying to write to us on the
// changed channel.
for {
select {
case died <- m:
return
... | go | func runMachine(context machineContext, m machine, changed <-chan struct{}, died chan<- machine, clock clock.Clock) {
defer func() {
// We can't just send on the died channel because the
// central loop might be trying to write to us on the
// changed channel.
for {
select {
case died <- m:
return
... | [
"func",
"runMachine",
"(",
"context",
"machineContext",
",",
"m",
"machine",
",",
"changed",
"<-",
"chan",
"struct",
"{",
"}",
",",
"died",
"chan",
"<-",
"machine",
",",
"clock",
"clock",
".",
"Clock",
")",
"{",
"defer",
"func",
"(",
")",
"{",
"// We c... | // runMachine processes the address and status publishing for a given machine.
// We assume that the machine is alive when this is first called. | [
"runMachine",
"processes",
"the",
"address",
"and",
"status",
"publishing",
"for",
"a",
"given",
"machine",
".",
"We",
"assume",
"that",
"the",
"machine",
"is",
"alive",
"when",
"this",
"is",
"first",
"called",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/instancepoller/updater.go#L166-L182 |
3,431 | juju/juju | worker/instancepoller/updater.go | pollInstanceInfo | func pollInstanceInfo(context machineContext, m machine) (instInfo instanceInfo, err error) {
instInfo = instanceInfo{}
instId, err := m.InstanceId()
// We can't ask the machine for its addresses if it isn't provisioned yet.
if params.IsCodeNotProvisioned(err) {
return instanceInfo{}, err
}
if err != nil {
re... | go | func pollInstanceInfo(context machineContext, m machine) (instInfo instanceInfo, err error) {
instInfo = instanceInfo{}
instId, err := m.InstanceId()
// We can't ask the machine for its addresses if it isn't provisioned yet.
if params.IsCodeNotProvisioned(err) {
return instanceInfo{}, err
}
if err != nil {
re... | [
"func",
"pollInstanceInfo",
"(",
"context",
"machineContext",
",",
"m",
"machine",
")",
"(",
"instInfo",
"instanceInfo",
",",
"err",
"error",
")",
"{",
"instInfo",
"=",
"instanceInfo",
"{",
"}",
"\n",
"instId",
",",
"err",
":=",
"m",
".",
"InstanceId",
"("... | // pollInstanceInfo checks the current provider addresses and status
// for the given machine's instance, and sets them on the machine if they've changed. | [
"pollInstanceInfo",
"checks",
"the",
"current",
"provider",
"addresses",
"and",
"status",
"for",
"the",
"given",
"machine",
"s",
"instance",
"and",
"sets",
"them",
"on",
"the",
"machine",
"if",
"they",
"ve",
"changed",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/instancepoller/updater.go#L251-L304 |
3,432 | juju/juju | worker/instancepoller/updater.go | addressesEqual | func addressesEqual(a0, a1 []network.Address) bool {
if len(a0) != len(a1) {
logger.Tracef("address lists have different lengths %d != %d for %v != %v",
len(a0), len(a1), a0, a1)
return false
}
ca0 := make([]network.Address, len(a0))
copy(ca0, a0)
network.SortAddresses(ca0)
ca1 := make([]network.Address, ... | go | func addressesEqual(a0, a1 []network.Address) bool {
if len(a0) != len(a1) {
logger.Tracef("address lists have different lengths %d != %d for %v != %v",
len(a0), len(a1), a0, a1)
return false
}
ca0 := make([]network.Address, len(a0))
copy(ca0, a0)
network.SortAddresses(ca0)
ca1 := make([]network.Address, ... | [
"func",
"addressesEqual",
"(",
"a0",
",",
"a1",
"[",
"]",
"network",
".",
"Address",
")",
"bool",
"{",
"if",
"len",
"(",
"a0",
")",
"!=",
"len",
"(",
"a1",
")",
"{",
"logger",
".",
"Tracef",
"(",
"\"",
"\"",
",",
"len",
"(",
"a0",
")",
",",
"... | // addressesEqual compares the addresses of the machine and the instance information. | [
"addressesEqual",
"compares",
"the",
"addresses",
"of",
"the",
"machine",
"and",
"the",
"instance",
"information",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/instancepoller/updater.go#L307-L329 |
3,433 | juju/juju | state/collection.go | Count | func (c *modelStateCollection) Count() (int, error) {
return c.WriteCollection.Find(bson.D{{"model-uuid", c.modelUUID}}).Count()
} | go | func (c *modelStateCollection) Count() (int, error) {
return c.WriteCollection.Find(bson.D{{"model-uuid", c.modelUUID}}).Count()
} | [
"func",
"(",
"c",
"*",
"modelStateCollection",
")",
"Count",
"(",
")",
"(",
"int",
",",
"error",
")",
"{",
"return",
"c",
".",
"WriteCollection",
".",
"Find",
"(",
"bson",
".",
"D",
"{",
"{",
"\"",
"\"",
",",
"c",
".",
"modelUUID",
"}",
"}",
")",... | // Count returns the number of documents in the collection that belong
// to the model that the modelStateCollection is filtering on. | [
"Count",
"returns",
"the",
"number",
"of",
"documents",
"in",
"the",
"collection",
"that",
"belong",
"to",
"the",
"model",
"that",
"the",
"modelStateCollection",
"is",
"filtering",
"on",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/collection.go#L33-L35 |
3,434 | juju/juju | state/collection.go | Insert | func (c *modelStateCollection) Insert(docs ...interface{}) error {
var mungedDocs []interface{}
for _, doc := range docs {
mungedDoc, err := mungeDocForMultiModel(doc, c.modelUUID, modelUUIDRequired)
if err != nil {
return errors.Trace(err)
}
mungedDocs = append(mungedDocs, mungedDoc)
}
return c.WriteCol... | go | func (c *modelStateCollection) Insert(docs ...interface{}) error {
var mungedDocs []interface{}
for _, doc := range docs {
mungedDoc, err := mungeDocForMultiModel(doc, c.modelUUID, modelUUIDRequired)
if err != nil {
return errors.Trace(err)
}
mungedDocs = append(mungedDocs, mungedDoc)
}
return c.WriteCol... | [
"func",
"(",
"c",
"*",
"modelStateCollection",
")",
"Insert",
"(",
"docs",
"...",
"interface",
"{",
"}",
")",
"error",
"{",
"var",
"mungedDocs",
"[",
"]",
"interface",
"{",
"}",
"\n",
"for",
"_",
",",
"doc",
":=",
"range",
"docs",
"{",
"mungedDoc",
"... | // Insert adds one or more documents to a collection. If the document
// id is a string the model UUID prefix will be automatically
// added to it. The model-uuid field will also be automatically added if
// it is missing. An error will be returned if an model-uuid field is
// provided but is the wrong value. | [
"Insert",
"adds",
"one",
"or",
"more",
"documents",
"to",
"a",
"collection",
".",
"If",
"the",
"document",
"id",
"is",
"a",
"string",
"the",
"model",
"UUID",
"prefix",
"will",
"be",
"automatically",
"added",
"to",
"it",
".",
"The",
"model",
"-",
"uuid",
... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/collection.go#L68-L78 |
3,435 | juju/juju | state/collection.go | UpdateId | func (c *modelStateCollection) UpdateId(id interface{}, update interface{}) error {
if sid, ok := id.(string); ok {
return c.WriteCollection.UpdateId(ensureModelUUID(c.modelUUID, sid), update)
}
return c.WriteCollection.UpdateId(bson.D{{"_id", id}}, update)
} | go | func (c *modelStateCollection) UpdateId(id interface{}, update interface{}) error {
if sid, ok := id.(string); ok {
return c.WriteCollection.UpdateId(ensureModelUUID(c.modelUUID, sid), update)
}
return c.WriteCollection.UpdateId(bson.D{{"_id", id}}, update)
} | [
"func",
"(",
"c",
"*",
"modelStateCollection",
")",
"UpdateId",
"(",
"id",
"interface",
"{",
"}",
",",
"update",
"interface",
"{",
"}",
")",
"error",
"{",
"if",
"sid",
",",
"ok",
":=",
"id",
".",
"(",
"string",
")",
";",
"ok",
"{",
"return",
"c",
... | // UpdateId finds a single document by _id and modifies it according to the
// update document. The id must be a string or bson.ObjectId. The model
// UUID will be automatically prefixed on to the id if it's a string and the
// prefix isn't there already. | [
"UpdateId",
"finds",
"a",
"single",
"document",
"by",
"_id",
"and",
"modifies",
"it",
"according",
"to",
"the",
"update",
"document",
".",
"The",
"id",
"must",
"be",
"a",
"string",
"or",
"bson",
".",
"ObjectId",
".",
"The",
"model",
"UUID",
"will",
"be",... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/collection.go#L100-L105 |
3,436 | juju/juju | apiserver/facades/client/action/run.go | getAllUnitNames | func getAllUnitNames(st *state.State, units, services []string) (result []names.Tag, err error) {
var leaders map[string]string
getLeader := func(appName string) (string, error) {
if leaders == nil {
var err error
leaders, err = st.ApplicationLeaders()
if err != nil {
return "", err
}
}
if leade... | go | func getAllUnitNames(st *state.State, units, services []string) (result []names.Tag, err error) {
var leaders map[string]string
getLeader := func(appName string) (string, error) {
if leaders == nil {
var err error
leaders, err = st.ApplicationLeaders()
if err != nil {
return "", err
}
}
if leade... | [
"func",
"getAllUnitNames",
"(",
"st",
"*",
"state",
".",
"State",
",",
"units",
",",
"services",
"[",
"]",
"string",
")",
"(",
"result",
"[",
"]",
"names",
".",
"Tag",
",",
"err",
"error",
")",
"{",
"var",
"leaders",
"map",
"[",
"string",
"]",
"str... | // getAllUnitNames returns a sequence of valid Unit objects from state. If any
// of the application names or unit names are not found, an error is returned. | [
"getAllUnitNames",
"returns",
"a",
"sequence",
"of",
"valid",
"Unit",
"objects",
"from",
"state",
".",
"If",
"any",
"of",
"the",
"application",
"names",
"or",
"unit",
"names",
"are",
"not",
"found",
"an",
"error",
"is",
"returned",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/action/run.go#L22-L76 |
3,437 | juju/juju | apiserver/facades/client/action/run.go | Run | func (a *ActionAPI) Run(run params.RunParams) (results params.ActionResults, err error) {
if err := a.checkCanAdmin(); err != nil {
return results, err
}
if err := a.check.ChangeAllowed(); err != nil {
return results, errors.Trace(err)
}
units, err := getAllUnitNames(a.state, run.Units, run.Applications)
if... | go | func (a *ActionAPI) Run(run params.RunParams) (results params.ActionResults, err error) {
if err := a.checkCanAdmin(); err != nil {
return results, err
}
if err := a.check.ChangeAllowed(); err != nil {
return results, errors.Trace(err)
}
units, err := getAllUnitNames(a.state, run.Units, run.Applications)
if... | [
"func",
"(",
"a",
"*",
"ActionAPI",
")",
"Run",
"(",
"run",
"params",
".",
"RunParams",
")",
"(",
"results",
"params",
".",
"ActionResults",
",",
"err",
"error",
")",
"{",
"if",
"err",
":=",
"a",
".",
"checkCanAdmin",
"(",
")",
";",
"err",
"!=",
"n... | // Run the commands specified on the machines identified through the
// list of machines, units and services. | [
"Run",
"the",
"commands",
"specified",
"on",
"the",
"machines",
"identified",
"through",
"the",
"list",
"of",
"machines",
"units",
"and",
"services",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/action/run.go#L80-L105 |
3,438 | juju/juju | apiserver/facades/client/action/run.go | RunOnAllMachines | func (a *ActionAPI) RunOnAllMachines(run params.RunParams) (results params.ActionResults, err error) {
if err := a.checkCanAdmin(); err != nil {
return results, err
}
if err := a.check.ChangeAllowed(); err != nil {
return results, errors.Trace(err)
}
machines, err := a.state.AllMachines()
if err != nil {
... | go | func (a *ActionAPI) RunOnAllMachines(run params.RunParams) (results params.ActionResults, err error) {
if err := a.checkCanAdmin(); err != nil {
return results, err
}
if err := a.check.ChangeAllowed(); err != nil {
return results, errors.Trace(err)
}
machines, err := a.state.AllMachines()
if err != nil {
... | [
"func",
"(",
"a",
"*",
"ActionAPI",
")",
"RunOnAllMachines",
"(",
"run",
"params",
".",
"RunParams",
")",
"(",
"results",
"params",
".",
"ActionResults",
",",
"err",
"error",
")",
"{",
"if",
"err",
":=",
"a",
".",
"checkCanAdmin",
"(",
")",
";",
"err",... | // RunOnAllMachines attempts to run the specified command on all the machines. | [
"RunOnAllMachines",
"attempts",
"to",
"run",
"the",
"specified",
"command",
"on",
"all",
"the",
"machines",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/facades/client/action/run.go#L108-L129 |
3,439 | juju/juju | worker/migrationflag/manifold.go | bounceErrChanged | func bounceErrChanged(err error) error {
if errors.Cause(err) == ErrChanged {
return dependency.ErrBounce
}
return err
} | go | func bounceErrChanged(err error) error {
if errors.Cause(err) == ErrChanged {
return dependency.ErrBounce
}
return err
} | [
"func",
"bounceErrChanged",
"(",
"err",
"error",
")",
"error",
"{",
"if",
"errors",
".",
"Cause",
"(",
"err",
")",
"==",
"ErrChanged",
"{",
"return",
"dependency",
".",
"ErrBounce",
"\n",
"}",
"\n",
"return",
"err",
"\n",
"}"
] | // bounceErrChanged converts ErrChanged to dependency.ErrBounce. | [
"bounceErrChanged",
"converts",
"ErrChanged",
"to",
"dependency",
".",
"ErrBounce",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/migrationflag/manifold.go#L81-L86 |
3,440 | juju/juju | upgrades/steps_237.go | stateStepsFor237 | func stateStepsFor237() []Step {
return []Step{
&upgradeStep{
description: "ensure container-image-stream isn't set in applications",
targets: []Target{DatabaseMaster},
run: func(context Context) error {
return context.State().RemoveContainerImageStreamFromNonModelSettings()
},
},
}
} | go | func stateStepsFor237() []Step {
return []Step{
&upgradeStep{
description: "ensure container-image-stream isn't set in applications",
targets: []Target{DatabaseMaster},
run: func(context Context) error {
return context.State().RemoveContainerImageStreamFromNonModelSettings()
},
},
}
} | [
"func",
"stateStepsFor237",
"(",
")",
"[",
"]",
"Step",
"{",
"return",
"[",
"]",
"Step",
"{",
"&",
"upgradeStep",
"{",
"description",
":",
"\"",
"\"",
",",
"targets",
":",
"[",
"]",
"Target",
"{",
"DatabaseMaster",
"}",
",",
"run",
":",
"func",
"(",
... | // stateStepsFor237 returns upgrade steps for Juju 2.3.7 that manipulate state directly. | [
"stateStepsFor237",
"returns",
"upgrade",
"steps",
"for",
"Juju",
"2",
".",
"3",
".",
"7",
"that",
"manipulate",
"state",
"directly",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/upgrades/steps_237.go#L7-L17 |
3,441 | juju/juju | cmd/jujud/main.go | hookToolMain | func hookToolMain(commandName string, ctx *cmd.Context, args []string) (code int, err error) {
code = 1
contextId, err := getenv("JUJU_CONTEXT_ID")
if err != nil {
return
}
dir, err := getwd()
if err != nil {
return
}
req := jujuc.Request{
ContextId: contextId,
Dir: dir,
CommandName: command... | go | func hookToolMain(commandName string, ctx *cmd.Context, args []string) (code int, err error) {
code = 1
contextId, err := getenv("JUJU_CONTEXT_ID")
if err != nil {
return
}
dir, err := getwd()
if err != nil {
return
}
req := jujuc.Request{
ContextId: contextId,
Dir: dir,
CommandName: command... | [
"func",
"hookToolMain",
"(",
"commandName",
"string",
",",
"ctx",
"*",
"cmd",
".",
"Context",
",",
"args",
"[",
"]",
"string",
")",
"(",
"code",
"int",
",",
"err",
"error",
")",
"{",
"code",
"=",
"1",
"\n",
"contextId",
",",
"err",
":=",
"getenv",
... | // hookToolMain uses JUJU_CONTEXT_ID and JUJU_AGENT_SOCKET to ask a running unit agent
// to execute a Command on our behalf. Individual commands should be exposed
// by symlinking the command name to this executable. | [
"hookToolMain",
"uses",
"JUJU_CONTEXT_ID",
"and",
"JUJU_AGENT_SOCKET",
"to",
"ask",
"a",
"running",
"unit",
"agent",
"to",
"execute",
"a",
"Command",
"on",
"our",
"behalf",
".",
"Individual",
"commands",
"should",
"be",
"exposed",
"by",
"symlinking",
"the",
"com... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/jujud/main.go#L97-L139 |
3,442 | juju/juju | cmd/jujud/main.go | jujuDMain | func jujuDMain(args []string, ctx *cmd.Context) (code int, err error) {
// Assuming an average of 200 bytes per log message, use up to
// 200MB for the log buffer.
defer logger.Debugf("jujud complete, code %d, err %v", code, err)
bufferedLogger, err := logsender.InstallBufferedLogWriter(1048576)
if err != nil {
... | go | func jujuDMain(args []string, ctx *cmd.Context) (code int, err error) {
// Assuming an average of 200 bytes per log message, use up to
// 200MB for the log buffer.
defer logger.Debugf("jujud complete, code %d, err %v", code, err)
bufferedLogger, err := logsender.InstallBufferedLogWriter(1048576)
if err != nil {
... | [
"func",
"jujuDMain",
"(",
"args",
"[",
"]",
"string",
",",
"ctx",
"*",
"cmd",
".",
"Context",
")",
"(",
"code",
"int",
",",
"err",
"error",
")",
"{",
"// Assuming an average of 200 bytes per log message, use up to",
"// 200MB for the log buffer.",
"defer",
"logger",... | // Main registers subcommands for the jujud executable, and hands over control
// to the cmd package. | [
"Main",
"registers",
"subcommands",
"for",
"the",
"jujud",
"executable",
"and",
"hands",
"over",
"control",
"to",
"the",
"cmd",
"package",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/jujud/main.go#L143-L201 |
3,443 | juju/juju | worker/storageprovisioner/caasworker.go | saveApplicationWorker | func (p *provisioner) saveApplicationWorker(appName string, aw worker.Worker) {
p.mu.Lock()
defer p.mu.Unlock()
if p.provisioners == nil {
p.provisioners = make(map[string]worker.Worker)
}
p.provisioners[appName] = aw
} | go | func (p *provisioner) saveApplicationWorker(appName string, aw worker.Worker) {
p.mu.Lock()
defer p.mu.Unlock()
if p.provisioners == nil {
p.provisioners = make(map[string]worker.Worker)
}
p.provisioners[appName] = aw
} | [
"func",
"(",
"p",
"*",
"provisioner",
")",
"saveApplicationWorker",
"(",
"appName",
"string",
",",
"aw",
"worker",
".",
"Worker",
")",
"{",
"p",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"p",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"if",... | // These helper methods protect the provisioners map so we can access for testing. | [
"These",
"helper",
"methods",
"protect",
"the",
"provisioners",
"map",
"so",
"we",
"can",
"access",
"for",
"testing",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/storageprovisioner/caasworker.go#L62-L70 |
3,444 | juju/juju | api/action/run.go | RunOnAllMachines | func (c *Client) RunOnAllMachines(commands string, timeout time.Duration) ([]params.ActionResult, error) {
var results params.ActionResults
args := params.RunParams{Commands: commands, Timeout: timeout}
err := c.facade.FacadeCall("RunOnAllMachines", args, &results)
return results.Results, err
} | go | func (c *Client) RunOnAllMachines(commands string, timeout time.Duration) ([]params.ActionResult, error) {
var results params.ActionResults
args := params.RunParams{Commands: commands, Timeout: timeout}
err := c.facade.FacadeCall("RunOnAllMachines", args, &results)
return results.Results, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"RunOnAllMachines",
"(",
"commands",
"string",
",",
"timeout",
"time",
".",
"Duration",
")",
"(",
"[",
"]",
"params",
".",
"ActionResult",
",",
"error",
")",
"{",
"var",
"results",
"params",
".",
"ActionResults",
"\n... | // RunOnAllMachines runs the command on all the machines with the specified
// timeout. | [
"RunOnAllMachines",
"runs",
"the",
"command",
"on",
"all",
"the",
"machines",
"with",
"the",
"specified",
"timeout",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/action/run.go#L14-L19 |
3,445 | juju/juju | api/action/run.go | Run | func (c *Client) Run(run params.RunParams) ([]params.ActionResult, error) {
var results params.ActionResults
err := c.facade.FacadeCall("Run", run, &results)
return results.Results, err
} | go | func (c *Client) Run(run params.RunParams) ([]params.ActionResult, error) {
var results params.ActionResults
err := c.facade.FacadeCall("Run", run, &results)
return results.Results, err
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"Run",
"(",
"run",
"params",
".",
"RunParams",
")",
"(",
"[",
"]",
"params",
".",
"ActionResult",
",",
"error",
")",
"{",
"var",
"results",
"params",
".",
"ActionResults",
"\n",
"err",
":=",
"c",
".",
"facade",
... | // Run the Commands specified on the machines identified through the ids
// provided in the machines, applications and units slices. | [
"Run",
"the",
"Commands",
"specified",
"on",
"the",
"machines",
"identified",
"through",
"the",
"ids",
"provided",
"in",
"the",
"machines",
"applications",
"and",
"units",
"slices",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/api/action/run.go#L23-L27 |
3,446 | juju/juju | state/stateenvirons/config.go | CloudAPIVersion | func (g EnvironConfigGetter) CloudAPIVersion(spec environs.CloudSpec) (string, error) {
// Only CAAS models have an API version we care about right now.
if g.Model.Type() == state.ModelTypeIAAS {
return "", nil
}
cfg, err := g.ModelConfig()
if err != nil {
return "", errors.Trace(err)
}
ctrlCfg, err := g.Con... | go | func (g EnvironConfigGetter) CloudAPIVersion(spec environs.CloudSpec) (string, error) {
// Only CAAS models have an API version we care about right now.
if g.Model.Type() == state.ModelTypeIAAS {
return "", nil
}
cfg, err := g.ModelConfig()
if err != nil {
return "", errors.Trace(err)
}
ctrlCfg, err := g.Con... | [
"func",
"(",
"g",
"EnvironConfigGetter",
")",
"CloudAPIVersion",
"(",
"spec",
"environs",
".",
"CloudSpec",
")",
"(",
"string",
",",
"error",
")",
"{",
"// Only CAAS models have an API version we care about right now.",
"if",
"g",
".",
"Model",
".",
"Type",
"(",
"... | // CloudAPIVersion returns the cloud API version for the cloud with the given spec. | [
"CloudAPIVersion",
"returns",
"the",
"cloud",
"API",
"version",
"for",
"the",
"cloud",
"with",
"the",
"given",
"spec",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/stateenvirons/config.go#L31-L57 |
3,447 | juju/juju | state/stateenvirons/config.go | GetNewEnvironFunc | func GetNewEnvironFunc(newEnviron environs.NewEnvironFunc) NewEnvironFunc {
return func(st *state.State) (environs.Environ, error) {
m, err := st.Model()
if err != nil {
return nil, errors.Trace(err)
}
g := EnvironConfigGetter{State: st, Model: m}
return environs.GetEnviron(g, newEnviron)
}
} | go | func GetNewEnvironFunc(newEnviron environs.NewEnvironFunc) NewEnvironFunc {
return func(st *state.State) (environs.Environ, error) {
m, err := st.Model()
if err != nil {
return nil, errors.Trace(err)
}
g := EnvironConfigGetter{State: st, Model: m}
return environs.GetEnviron(g, newEnviron)
}
} | [
"func",
"GetNewEnvironFunc",
"(",
"newEnviron",
"environs",
".",
"NewEnvironFunc",
")",
"NewEnvironFunc",
"{",
"return",
"func",
"(",
"st",
"*",
"state",
".",
"State",
")",
"(",
"environs",
".",
"Environ",
",",
"error",
")",
"{",
"m",
",",
"err",
":=",
"... | // GetNewEnvironFunc returns a NewEnvironFunc, that constructs Environs
// using the given environs.NewEnvironFunc. | [
"GetNewEnvironFunc",
"returns",
"a",
"NewEnvironFunc",
"that",
"constructs",
"Environs",
"using",
"the",
"given",
"environs",
".",
"NewEnvironFunc",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/stateenvirons/config.go#L102-L111 |
3,448 | juju/juju | state/stateenvirons/config.go | GetNewCAASBrokerFunc | func GetNewCAASBrokerFunc(newBroker caas.NewContainerBrokerFunc) NewCAASBrokerFunc {
return func(st *state.State) (caas.Broker, error) {
m, err := st.Model()
if err != nil {
return nil, errors.Trace(err)
}
g := EnvironConfigGetter{State: st, Model: m}
cloudSpec, err := g.CloudSpec()
if err != nil {
r... | go | func GetNewCAASBrokerFunc(newBroker caas.NewContainerBrokerFunc) NewCAASBrokerFunc {
return func(st *state.State) (caas.Broker, error) {
m, err := st.Model()
if err != nil {
return nil, errors.Trace(err)
}
g := EnvironConfigGetter{State: st, Model: m}
cloudSpec, err := g.CloudSpec()
if err != nil {
r... | [
"func",
"GetNewCAASBrokerFunc",
"(",
"newBroker",
"caas",
".",
"NewContainerBrokerFunc",
")",
"NewCAASBrokerFunc",
"{",
"return",
"func",
"(",
"st",
"*",
"state",
".",
"State",
")",
"(",
"caas",
".",
"Broker",
",",
"error",
")",
"{",
"m",
",",
"err",
":=",... | // GetNewCAASBrokerFunc returns a NewCAASBrokerFunc, that constructs CAAS brokers
// using the given caas.NewContainerBrokerFunc. | [
"GetNewCAASBrokerFunc",
"returns",
"a",
"NewCAASBrokerFunc",
"that",
"constructs",
"CAAS",
"brokers",
"using",
"the",
"given",
"caas",
".",
"NewContainerBrokerFunc",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/stateenvirons/config.go#L119-L144 |
3,449 | juju/juju | state/modeluser.go | setModelAccess | func (st *State) setModelAccess(access permission.Access, userGlobalKey, modelUUID string) error {
if err := permission.ValidateModelAccess(access); err != nil {
return errors.Trace(err)
}
op := updatePermissionOp(modelKey(modelUUID), userGlobalKey, access)
err := st.db().RunTransactionFor(modelUUID, []txn.Op{op}... | go | func (st *State) setModelAccess(access permission.Access, userGlobalKey, modelUUID string) error {
if err := permission.ValidateModelAccess(access); err != nil {
return errors.Trace(err)
}
op := updatePermissionOp(modelKey(modelUUID), userGlobalKey, access)
err := st.db().RunTransactionFor(modelUUID, []txn.Op{op}... | [
"func",
"(",
"st",
"*",
"State",
")",
"setModelAccess",
"(",
"access",
"permission",
".",
"Access",
",",
"userGlobalKey",
",",
"modelUUID",
"string",
")",
"error",
"{",
"if",
"err",
":=",
"permission",
".",
"ValidateModelAccess",
"(",
"access",
")",
";",
"... | // setModelAccess changes the user's access permissions on the model. | [
"setModelAccess",
"changes",
"the",
"user",
"s",
"access",
"permissions",
"on",
"the",
"model",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L34-L44 |
3,450 | juju/juju | state/modeluser.go | LastModelConnection | func (m *Model) LastModelConnection(user names.UserTag) (time.Time, error) {
lastConnections, closer := m.st.db().GetRawCollection(modelUserLastConnectionC)
defer closer()
username := user.Id()
var lastConn modelUserLastConnectionDoc
err := lastConnections.FindId(m.st.docID(username)).Select(bson.D{{"last-connect... | go | func (m *Model) LastModelConnection(user names.UserTag) (time.Time, error) {
lastConnections, closer := m.st.db().GetRawCollection(modelUserLastConnectionC)
defer closer()
username := user.Id()
var lastConn modelUserLastConnectionDoc
err := lastConnections.FindId(m.st.docID(username)).Select(bson.D{{"last-connect... | [
"func",
"(",
"m",
"*",
"Model",
")",
"LastModelConnection",
"(",
"user",
"names",
".",
"UserTag",
")",
"(",
"time",
".",
"Time",
",",
"error",
")",
"{",
"lastConnections",
",",
"closer",
":=",
"m",
".",
"st",
".",
"db",
"(",
")",
".",
"GetRawCollecti... | // LastModelConnection returns when this User last connected through the API
// in UTC. The resulting time will be nil if the user has never logged in. | [
"LastModelConnection",
"returns",
"when",
"this",
"User",
"last",
"connected",
"through",
"the",
"API",
"in",
"UTC",
".",
"The",
"resulting",
"time",
"will",
"be",
"nil",
"if",
"the",
"user",
"has",
"never",
"logged",
"in",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L48-L63 |
3,451 | juju/juju | state/modeluser.go | IsNeverConnectedError | func IsNeverConnectedError(err error) bool {
_, ok := errors.Cause(err).(NeverConnectedError)
return ok
} | go | func IsNeverConnectedError(err error) bool {
_, ok := errors.Cause(err).(NeverConnectedError)
return ok
} | [
"func",
"IsNeverConnectedError",
"(",
"err",
"error",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"errors",
".",
"Cause",
"(",
"err",
")",
".",
"(",
"NeverConnectedError",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // IsNeverConnectedError returns true if err is of type NeverConnectedError. | [
"IsNeverConnectedError",
"returns",
"true",
"if",
"err",
"is",
"of",
"type",
"NeverConnectedError",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L76-L79 |
3,452 | juju/juju | state/modeluser.go | UpdateLastModelConnection | func (m *Model) UpdateLastModelConnection(user names.UserTag) error {
return m.updateLastModelConnection(user, m.st.nowToTheSecond())
} | go | func (m *Model) UpdateLastModelConnection(user names.UserTag) error {
return m.updateLastModelConnection(user, m.st.nowToTheSecond())
} | [
"func",
"(",
"m",
"*",
"Model",
")",
"UpdateLastModelConnection",
"(",
"user",
"names",
".",
"UserTag",
")",
"error",
"{",
"return",
"m",
".",
"updateLastModelConnection",
"(",
"user",
",",
"m",
".",
"st",
".",
"nowToTheSecond",
"(",
")",
")",
"\n",
"}"
... | // UpdateLastModelConnection updates the last connection time of the model user. | [
"UpdateLastModelConnection",
"updates",
"the",
"last",
"connection",
"time",
"of",
"the",
"model",
"user",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L82-L84 |
3,453 | juju/juju | state/modeluser.go | modelUser | func (st *State) modelUser(modelUUID string, user names.UserTag) (userAccessDoc, error) {
modelUser := userAccessDoc{}
modelUsers, closer := st.db().GetCollectionFor(modelUUID, modelUsersC)
defer closer()
username := strings.ToLower(user.Id())
err := modelUsers.FindId(username).One(&modelUser)
if err == mgo.ErrN... | go | func (st *State) modelUser(modelUUID string, user names.UserTag) (userAccessDoc, error) {
modelUser := userAccessDoc{}
modelUsers, closer := st.db().GetCollectionFor(modelUUID, modelUsersC)
defer closer()
username := strings.ToLower(user.Id())
err := modelUsers.FindId(username).One(&modelUser)
if err == mgo.ErrN... | [
"func",
"(",
"st",
"*",
"State",
")",
"modelUser",
"(",
"modelUUID",
"string",
",",
"user",
"names",
".",
"UserTag",
")",
"(",
"userAccessDoc",
",",
"error",
")",
"{",
"modelUser",
":=",
"userAccessDoc",
"{",
"}",
"\n",
"modelUsers",
",",
"closer",
":=",... | // ModelUser a model userAccessDoc. | [
"ModelUser",
"a",
"model",
"userAccessDoc",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L108-L125 |
3,454 | juju/juju | state/modeluser.go | removeModelUser | func (st *State) removeModelUser(user names.UserTag) error {
ops := removeModelUserOps(st.ModelUUID(), user)
err := st.db().RunTransaction(ops)
if err == txn.ErrAborted {
err = errors.NewNotFound(nil, fmt.Sprintf("model user %q does not exist", user.Id()))
}
if err != nil {
return errors.Trace(err)
}
return ... | go | func (st *State) removeModelUser(user names.UserTag) error {
ops := removeModelUserOps(st.ModelUUID(), user)
err := st.db().RunTransaction(ops)
if err == txn.ErrAborted {
err = errors.NewNotFound(nil, fmt.Sprintf("model user %q does not exist", user.Id()))
}
if err != nil {
return errors.Trace(err)
}
return ... | [
"func",
"(",
"st",
"*",
"State",
")",
"removeModelUser",
"(",
"user",
"names",
".",
"UserTag",
")",
"error",
"{",
"ops",
":=",
"removeModelUserOps",
"(",
"st",
".",
"ModelUUID",
"(",
")",
",",
"user",
")",
"\n",
"err",
":=",
"st",
".",
"db",
"(",
"... | // removeModelUser removes a user from the database. | [
"removeModelUser",
"removes",
"a",
"user",
"from",
"the",
"database",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L162-L172 |
3,455 | juju/juju | state/modeluser.go | isUserSuperuser | func (st *State) isUserSuperuser(user names.UserTag) (bool, error) {
access, err := st.UserAccess(user, st.controllerTag)
if err != nil {
// TODO(jam): 2017-11-27 We weren't suppressing NotFound here so that we would know when someone asked for
// the list of models of a user that doesn't exist.
// However, now... | go | func (st *State) isUserSuperuser(user names.UserTag) (bool, error) {
access, err := st.UserAccess(user, st.controllerTag)
if err != nil {
// TODO(jam): 2017-11-27 We weren't suppressing NotFound here so that we would know when someone asked for
// the list of models of a user that doesn't exist.
// However, now... | [
"func",
"(",
"st",
"*",
"State",
")",
"isUserSuperuser",
"(",
"user",
"names",
".",
"UserTag",
")",
"(",
"bool",
",",
"error",
")",
"{",
"access",
",",
"err",
":=",
"st",
".",
"UserAccess",
"(",
"user",
",",
"st",
".",
"controllerTag",
")",
"\n",
"... | // isUserSuperuser if this user has the Superuser access on the controller. | [
"isUserSuperuser",
"if",
"this",
"user",
"has",
"the",
"Superuser",
"access",
"on",
"the",
"controller",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L175-L185 |
3,456 | juju/juju | state/modeluser.go | modelQueryForUser | func (st *State) modelQueryForUser(user names.UserTag, isSuperuser bool) (mongo.Query, SessionCloser, error) {
var modelQuery mongo.Query
models, closer := st.db().GetCollection(modelsC)
if isSuperuser {
// Fast path, we just return all the models that aren't Importing
modelQuery = models.Find(bson.M{"migration-... | go | func (st *State) modelQueryForUser(user names.UserTag, isSuperuser bool) (mongo.Query, SessionCloser, error) {
var modelQuery mongo.Query
models, closer := st.db().GetCollection(modelsC)
if isSuperuser {
// Fast path, we just return all the models that aren't Importing
modelQuery = models.Find(bson.M{"migration-... | [
"func",
"(",
"st",
"*",
"State",
")",
"modelQueryForUser",
"(",
"user",
"names",
".",
"UserTag",
",",
"isSuperuser",
"bool",
")",
"(",
"mongo",
".",
"Query",
",",
"SessionCloser",
",",
"error",
")",
"{",
"var",
"modelQuery",
"mongo",
".",
"Query",
"\n",
... | // modelsForUser gives you the information about all models that a user has access to.
// This includes the name and UUID, as well as the last time the user connected to that model. | [
"modelsForUser",
"gives",
"you",
"the",
"information",
"about",
"all",
"models",
"that",
"a",
"user",
"has",
"access",
"to",
".",
"This",
"includes",
"the",
"name",
"and",
"UUID",
"as",
"well",
"as",
"the",
"last",
"time",
"the",
"user",
"connected",
"to",... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L234-L267 |
3,457 | juju/juju | state/modeluser.go | ModelBasicInfoForUser | func (st *State) ModelBasicInfoForUser(user names.UserTag) ([]ModelAccessInfo, error) {
isSuperuser, err := st.isUserSuperuser(user)
if err != nil {
return nil, errors.Trace(err)
}
modelQuery, closer1, err := st.modelQueryForUser(user, isSuperuser)
if err != nil {
return nil, errors.Trace(err)
}
defer closer... | go | func (st *State) ModelBasicInfoForUser(user names.UserTag) ([]ModelAccessInfo, error) {
isSuperuser, err := st.isUserSuperuser(user)
if err != nil {
return nil, errors.Trace(err)
}
modelQuery, closer1, err := st.modelQueryForUser(user, isSuperuser)
if err != nil {
return nil, errors.Trace(err)
}
defer closer... | [
"func",
"(",
"st",
"*",
"State",
")",
"ModelBasicInfoForUser",
"(",
"user",
"names",
".",
"UserTag",
")",
"(",
"[",
"]",
"ModelAccessInfo",
",",
"error",
")",
"{",
"isSuperuser",
",",
"err",
":=",
"st",
".",
"isUserSuperuser",
"(",
"user",
")",
"\n",
"... | // ModelBasicInfoForUser gives you the information about all models that a user has access to.
// This includes the name and UUID, as well as the last time the user connected to that model. | [
"ModelBasicInfoForUser",
"gives",
"you",
"the",
"information",
"about",
"all",
"models",
"that",
"a",
"user",
"has",
"access",
"to",
".",
"This",
"includes",
"the",
"name",
"and",
"UUID",
"as",
"well",
"as",
"the",
"last",
"time",
"the",
"user",
"connected",... | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L279-L319 |
3,458 | juju/juju | state/modeluser.go | IsControllerAdmin | func (st *State) IsControllerAdmin(user names.UserTag) (bool, error) {
model, err := st.Model()
if err != nil {
return false, errors.Trace(err)
}
ua, err := st.UserAccess(user, model.ControllerTag())
if errors.IsNotFound(err) {
return false, nil
}
if err != nil {
return false, errors.Trace(err)
}
return ... | go | func (st *State) IsControllerAdmin(user names.UserTag) (bool, error) {
model, err := st.Model()
if err != nil {
return false, errors.Trace(err)
}
ua, err := st.UserAccess(user, model.ControllerTag())
if errors.IsNotFound(err) {
return false, nil
}
if err != nil {
return false, errors.Trace(err)
}
return ... | [
"func",
"(",
"st",
"*",
"State",
")",
"IsControllerAdmin",
"(",
"user",
"names",
".",
"UserTag",
")",
"(",
"bool",
",",
"error",
")",
"{",
"model",
",",
"err",
":=",
"st",
".",
"Model",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"fa... | // IsControllerAdmin returns true if the user specified has Super User Access. | [
"IsControllerAdmin",
"returns",
"true",
"if",
"the",
"user",
"specified",
"has",
"Super",
"User",
"Access",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/state/modeluser.go#L379-L392 |
3,459 | juju/juju | agent/agent.go | SetAPIHostPorts | func (s APIHostPortsSetter) SetAPIHostPorts(servers [][]network.HostPort) error {
return s.ChangeConfig(func(c ConfigSetter) error {
c.SetAPIHostPorts(servers)
return nil
})
} | go | func (s APIHostPortsSetter) SetAPIHostPorts(servers [][]network.HostPort) error {
return s.ChangeConfig(func(c ConfigSetter) error {
c.SetAPIHostPorts(servers)
return nil
})
} | [
"func",
"(",
"s",
"APIHostPortsSetter",
")",
"SetAPIHostPorts",
"(",
"servers",
"[",
"]",
"[",
"]",
"network",
".",
"HostPort",
")",
"error",
"{",
"return",
"s",
".",
"ChangeConfig",
"(",
"func",
"(",
"c",
"ConfigSetter",
")",
"error",
"{",
"c",
".",
"... | // SetAPIHostPorts is the APIAddressSetter interface. | [
"SetAPIHostPorts",
"is",
"the",
"APIAddressSetter",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L73-L78 |
3,460 | juju/juju | agent/agent.go | Migrate | func (p *Paths) Migrate(newPaths Paths) {
if newPaths.DataDir != "" {
p.DataDir = newPaths.DataDir
}
if newPaths.LogDir != "" {
p.LogDir = newPaths.LogDir
}
if newPaths.MetricsSpoolDir != "" {
p.MetricsSpoolDir = newPaths.MetricsSpoolDir
}
if newPaths.ConfDir != "" {
p.ConfDir = newPaths.ConfDir
}
} | go | func (p *Paths) Migrate(newPaths Paths) {
if newPaths.DataDir != "" {
p.DataDir = newPaths.DataDir
}
if newPaths.LogDir != "" {
p.LogDir = newPaths.LogDir
}
if newPaths.MetricsSpoolDir != "" {
p.MetricsSpoolDir = newPaths.MetricsSpoolDir
}
if newPaths.ConfDir != "" {
p.ConfDir = newPaths.ConfDir
}
} | [
"func",
"(",
"p",
"*",
"Paths",
")",
"Migrate",
"(",
"newPaths",
"Paths",
")",
"{",
"if",
"newPaths",
".",
"DataDir",
"!=",
"\"",
"\"",
"{",
"p",
".",
"DataDir",
"=",
"newPaths",
".",
"DataDir",
"\n",
"}",
"\n",
"if",
"newPaths",
".",
"LogDir",
"!=... | // Migrate assigns the directory locations specified from the new path configuration. | [
"Migrate",
"assigns",
"the",
"directory",
"locations",
"specified",
"from",
"the",
"new",
"path",
"configuration",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L97-L110 |
3,461 | juju/juju | agent/agent.go | NewPathsWithDefaults | func NewPathsWithDefaults(p Paths) Paths {
paths := DefaultPaths
if p.DataDir != "" {
paths.DataDir = p.DataDir
}
if p.LogDir != "" {
paths.LogDir = p.LogDir
}
if p.MetricsSpoolDir != "" {
paths.MetricsSpoolDir = p.MetricsSpoolDir
}
if p.ConfDir != "" {
paths.ConfDir = p.ConfDir
}
return paths
} | go | func NewPathsWithDefaults(p Paths) Paths {
paths := DefaultPaths
if p.DataDir != "" {
paths.DataDir = p.DataDir
}
if p.LogDir != "" {
paths.LogDir = p.LogDir
}
if p.MetricsSpoolDir != "" {
paths.MetricsSpoolDir = p.MetricsSpoolDir
}
if p.ConfDir != "" {
paths.ConfDir = p.ConfDir
}
return paths
} | [
"func",
"NewPathsWithDefaults",
"(",
"p",
"Paths",
")",
"Paths",
"{",
"paths",
":=",
"DefaultPaths",
"\n",
"if",
"p",
".",
"DataDir",
"!=",
"\"",
"\"",
"{",
"paths",
".",
"DataDir",
"=",
"p",
".",
"DataDir",
"\n",
"}",
"\n",
"if",
"p",
".",
"LogDir",... | // NewPathsWithDefaults returns a Paths struct initialized with default locations if not otherwise specified. | [
"NewPathsWithDefaults",
"returns",
"a",
"Paths",
"struct",
"initialized",
"with",
"default",
"locations",
"if",
"not",
"otherwise",
"specified",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L113-L128 |
3,462 | juju/juju | agent/agent.go | LogFilename | func LogFilename(c Config) string {
return filepath.Join(c.LogDir(), c.Tag().String()+".log")
} | go | func LogFilename(c Config) string {
return filepath.Join(c.LogDir(), c.Tag().String()+".log")
} | [
"func",
"LogFilename",
"(",
"c",
"Config",
")",
"string",
"{",
"return",
"filepath",
".",
"Join",
"(",
"c",
".",
"LogDir",
"(",
")",
",",
"c",
".",
"Tag",
"(",
")",
".",
"String",
"(",
")",
"+",
"\"",
"\"",
")",
"\n",
"}"
] | // LogFileName returns the filename for the Agent's log file. | [
"LogFileName",
"returns",
"the",
"filename",
"for",
"the",
"Agent",
"s",
"log",
"file",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L322-L324 |
3,463 | juju/juju | agent/agent.go | MachineLockLogFilename | func MachineLockLogFilename(c Config) string {
return filepath.Join(c.LogDir(), machinelock.Filename)
} | go | func MachineLockLogFilename(c Config) string {
return filepath.Join(c.LogDir(), machinelock.Filename)
} | [
"func",
"MachineLockLogFilename",
"(",
"c",
"Config",
")",
"string",
"{",
"return",
"filepath",
".",
"Join",
"(",
"c",
".",
"LogDir",
"(",
")",
",",
"machinelock",
".",
"Filename",
")",
"\n",
"}"
] | // MachineLockLogFilename returns the filename for the machine lock log file. | [
"MachineLockLogFilename",
"returns",
"the",
"filename",
"for",
"the",
"machine",
"lock",
"log",
"file",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L327-L329 |
3,464 | juju/juju | agent/agent.go | NewAgentConfig | func NewAgentConfig(configParams AgentConfigParams) (ConfigSetterWriter, error) {
if configParams.Paths.DataDir == "" {
return nil, errors.Trace(requiredError("data directory"))
}
if configParams.Tag == nil {
return nil, errors.Trace(requiredError("entity tag"))
}
switch configParams.Tag.(type) {
case names.M... | go | func NewAgentConfig(configParams AgentConfigParams) (ConfigSetterWriter, error) {
if configParams.Paths.DataDir == "" {
return nil, errors.Trace(requiredError("data directory"))
}
if configParams.Tag == nil {
return nil, errors.Trace(requiredError("entity tag"))
}
switch configParams.Tag.(type) {
case names.M... | [
"func",
"NewAgentConfig",
"(",
"configParams",
"AgentConfigParams",
")",
"(",
"ConfigSetterWriter",
",",
"error",
")",
"{",
"if",
"configParams",
".",
"Paths",
".",
"DataDir",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",
"errors",
".",
"Trace",
"(",
"require... | // NewAgentConfig returns a new config object suitable for use for a
// machine or unit agent. | [
"NewAgentConfig",
"returns",
"a",
"new",
"config",
"object",
"suitable",
"for",
"use",
"for",
"a",
"machine",
"or",
"unit",
"agent",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L414-L481 |
3,465 | juju/juju | agent/agent.go | NewStateMachineConfig | func NewStateMachineConfig(configParams AgentConfigParams, serverInfo params.StateServingInfo) (ConfigSetterWriter, error) {
if serverInfo.Cert == "" {
return nil, errors.Trace(requiredError("controller cert"))
}
if serverInfo.PrivateKey == "" {
return nil, errors.Trace(requiredError("controller key"))
}
if se... | go | func NewStateMachineConfig(configParams AgentConfigParams, serverInfo params.StateServingInfo) (ConfigSetterWriter, error) {
if serverInfo.Cert == "" {
return nil, errors.Trace(requiredError("controller cert"))
}
if serverInfo.PrivateKey == "" {
return nil, errors.Trace(requiredError("controller key"))
}
if se... | [
"func",
"NewStateMachineConfig",
"(",
"configParams",
"AgentConfigParams",
",",
"serverInfo",
"params",
".",
"StateServingInfo",
")",
"(",
"ConfigSetterWriter",
",",
"error",
")",
"{",
"if",
"serverInfo",
".",
"Cert",
"==",
"\"",
"\"",
"{",
"return",
"nil",
",",... | // NewStateMachineConfig returns a configuration suitable for
// a machine running the controller. | [
"NewStateMachineConfig",
"returns",
"a",
"configuration",
"suitable",
"for",
"a",
"machine",
"running",
"the",
"controller",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L485-L507 |
3,466 | juju/juju | agent/agent.go | Dir | func Dir(dataDir string, tag names.Tag) string {
// Note: must use path, not filepath, as this
// function is used by the client on Windows.
return path.Join(BaseDir(dataDir), tag.String())
} | go | func Dir(dataDir string, tag names.Tag) string {
// Note: must use path, not filepath, as this
// function is used by the client on Windows.
return path.Join(BaseDir(dataDir), tag.String())
} | [
"func",
"Dir",
"(",
"dataDir",
"string",
",",
"tag",
"names",
".",
"Tag",
")",
"string",
"{",
"// Note: must use path, not filepath, as this",
"// function is used by the client on Windows.",
"return",
"path",
".",
"Join",
"(",
"BaseDir",
"(",
"dataDir",
")",
",",
"... | // Dir returns the agent-specific data directory. | [
"Dir",
"returns",
"the",
"agent",
"-",
"specific",
"data",
"directory",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L518-L522 |
3,467 | juju/juju | agent/agent.go | ReadConfig | func ReadConfig(configFilePath string) (ConfigSetterWriter, error) {
var (
format formatter
config *configInternal
)
configData, err := ioutil.ReadFile(configFilePath)
if err != nil {
return nil, errors.Annotatef(err, "cannot read agent config %q", configFilePath)
}
format, config, err = parseConfigData(con... | go | func ReadConfig(configFilePath string) (ConfigSetterWriter, error) {
var (
format formatter
config *configInternal
)
configData, err := ioutil.ReadFile(configFilePath)
if err != nil {
return nil, errors.Annotatef(err, "cannot read agent config %q", configFilePath)
}
format, config, err = parseConfigData(con... | [
"func",
"ReadConfig",
"(",
"configFilePath",
"string",
")",
"(",
"ConfigSetterWriter",
",",
"error",
")",
"{",
"var",
"(",
"format",
"formatter",
"\n",
"config",
"*",
"configInternal",
"\n",
")",
"\n",
"configData",
",",
"err",
":=",
"ioutil",
".",
"ReadFile... | // ReadConfig reads configuration data from the given location. | [
"ReadConfig",
"reads",
"configuration",
"data",
"from",
"the",
"given",
"location",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L532-L548 |
3,468 | juju/juju | agent/agent.go | MongoVersion | func (c *configInternal) MongoVersion() mongo.Version {
v, err := mongo.NewVersion(c.mongoVersion)
if err != nil {
return mongo.Mongo24
}
return v
} | go | func (c *configInternal) MongoVersion() mongo.Version {
v, err := mongo.NewVersion(c.mongoVersion)
if err != nil {
return mongo.Mongo24
}
return v
} | [
"func",
"(",
"c",
"*",
"configInternal",
")",
"MongoVersion",
"(",
")",
"mongo",
".",
"Version",
"{",
"v",
",",
"err",
":=",
"mongo",
".",
"NewVersion",
"(",
"c",
".",
"mongoVersion",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"mongo",
".",
... | // MongoVersion implements Config. | [
"MongoVersion",
"implements",
"Config",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L736-L742 |
3,469 | juju/juju | agent/agent.go | MongoMemoryProfile | func (c *configInternal) MongoMemoryProfile() mongo.MemoryProfile {
mprof := mongo.MemoryProfile(c.mongoMemoryProfile)
if err := mprof.Validate(); err != nil {
return mongo.MemoryProfileLow
}
return mongo.MemoryProfile(c.mongoMemoryProfile)
} | go | func (c *configInternal) MongoMemoryProfile() mongo.MemoryProfile {
mprof := mongo.MemoryProfile(c.mongoMemoryProfile)
if err := mprof.Validate(); err != nil {
return mongo.MemoryProfileLow
}
return mongo.MemoryProfile(c.mongoMemoryProfile)
} | [
"func",
"(",
"c",
"*",
"configInternal",
")",
"MongoMemoryProfile",
"(",
")",
"mongo",
".",
"MemoryProfile",
"{",
"mprof",
":=",
"mongo",
".",
"MemoryProfile",
"(",
"c",
".",
"mongoMemoryProfile",
")",
"\n",
"if",
"err",
":=",
"mprof",
".",
"Validate",
"("... | // MongoMemoryProfile implements Config. | [
"MongoMemoryProfile",
"implements",
"Config",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L745-L751 |
3,470 | juju/juju | agent/agent.go | SetMongoVersion | func (c *configInternal) SetMongoVersion(v mongo.Version) {
c.mongoVersion = v.String()
} | go | func (c *configInternal) SetMongoVersion(v mongo.Version) {
c.mongoVersion = v.String()
} | [
"func",
"(",
"c",
"*",
"configInternal",
")",
"SetMongoVersion",
"(",
"v",
"mongo",
".",
"Version",
")",
"{",
"c",
".",
"mongoVersion",
"=",
"v",
".",
"String",
"(",
")",
"\n",
"}"
] | // SetMongoVersion implements configSetterOnly. | [
"SetMongoVersion",
"implements",
"configSetterOnly",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L754-L756 |
3,471 | juju/juju | agent/agent.go | SetMongoMemoryProfile | func (c *configInternal) SetMongoMemoryProfile(v mongo.MemoryProfile) {
c.mongoMemoryProfile = v.String()
} | go | func (c *configInternal) SetMongoMemoryProfile(v mongo.MemoryProfile) {
c.mongoMemoryProfile = v.String()
} | [
"func",
"(",
"c",
"*",
"configInternal",
")",
"SetMongoMemoryProfile",
"(",
"v",
"mongo",
".",
"MemoryProfile",
")",
"{",
"c",
".",
"mongoMemoryProfile",
"=",
"v",
".",
"String",
"(",
")",
"\n",
"}"
] | // SetMongoMemoryProfile implements configSetterOnly. | [
"SetMongoMemoryProfile",
"implements",
"configSetterOnly",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L759-L761 |
3,472 | juju/juju | agent/agent.go | WriteCommands | func (c *configInternal) WriteCommands(renderer shell.Renderer) ([]string, error) {
data, err := c.Render()
if err != nil {
return nil, errors.Trace(err)
}
commands := renderer.MkdirAll(c.Dir())
filename := c.File(AgentConfigFilename)
commands = append(commands, renderer.WriteFile(filename, data)...)
commands ... | go | func (c *configInternal) WriteCommands(renderer shell.Renderer) ([]string, error) {
data, err := c.Render()
if err != nil {
return nil, errors.Trace(err)
}
commands := renderer.MkdirAll(c.Dir())
filename := c.File(AgentConfigFilename)
commands = append(commands, renderer.WriteFile(filename, data)...)
commands ... | [
"func",
"(",
"c",
"*",
"configInternal",
")",
"WriteCommands",
"(",
"renderer",
"shell",
".",
"Renderer",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"data",
",",
"err",
":=",
"c",
".",
"Render",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // WriteCommands is defined on Config interface. | [
"WriteCommands",
"is",
"defined",
"on",
"Config",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L789-L799 |
3,473 | juju/juju | agent/agent.go | APIInfo | func (c *configInternal) APIInfo() (*api.Info, bool) {
if c.apiDetails == nil || c.apiDetails.addresses == nil {
return nil, false
}
servingInfo, isController := c.StateServingInfo()
addrs := c.apiDetails.addresses
// For controller we return only localhost - we should not connect
// to other controllers if we ... | go | func (c *configInternal) APIInfo() (*api.Info, bool) {
if c.apiDetails == nil || c.apiDetails.addresses == nil {
return nil, false
}
servingInfo, isController := c.StateServingInfo()
addrs := c.apiDetails.addresses
// For controller we return only localhost - we should not connect
// to other controllers if we ... | [
"func",
"(",
"c",
"*",
"configInternal",
")",
"APIInfo",
"(",
")",
"(",
"*",
"api",
".",
"Info",
",",
"bool",
")",
"{",
"if",
"c",
".",
"apiDetails",
"==",
"nil",
"||",
"c",
".",
"apiDetails",
".",
"addresses",
"==",
"nil",
"{",
"return",
"nil",
... | // APIInfo is defined on Config interface. | [
"APIInfo",
"is",
"defined",
"on",
"Config",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L802-L831 |
3,474 | juju/juju | agent/agent.go | MongoInfo | func (c *configInternal) MongoInfo() (info *mongo.MongoInfo, ok bool) {
ssi, ok := c.StateServingInfo()
if !ok {
return nil, false
}
// We return localhost first and then all addresses of known API
// endpoints - this lets us connect to other Mongo instances and start
// state even if our own Mongo has not star... | go | func (c *configInternal) MongoInfo() (info *mongo.MongoInfo, ok bool) {
ssi, ok := c.StateServingInfo()
if !ok {
return nil, false
}
// We return localhost first and then all addresses of known API
// endpoints - this lets us connect to other Mongo instances and start
// state even if our own Mongo has not star... | [
"func",
"(",
"c",
"*",
"configInternal",
")",
"MongoInfo",
"(",
")",
"(",
"info",
"*",
"mongo",
".",
"MongoInfo",
",",
"ok",
"bool",
")",
"{",
"ssi",
",",
"ok",
":=",
"c",
".",
"StateServingInfo",
"(",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"... | // MongoInfo is defined on Config interface. | [
"MongoInfo",
"is",
"defined",
"on",
"Config",
"interface",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/agent/agent.go#L834-L865 |
3,475 | juju/juju | apiserver/restrict_caasmodel.go | isCAASModelFacade | func isCAASModelFacade(facadeName string) bool {
return caasModelFacadeNames.Contains(facadeName) ||
commonModelFacadeNames.Contains(facadeName) ||
commonFacadeNames.Contains(facadeName)
} | go | func isCAASModelFacade(facadeName string) bool {
return caasModelFacadeNames.Contains(facadeName) ||
commonModelFacadeNames.Contains(facadeName) ||
commonFacadeNames.Contains(facadeName)
} | [
"func",
"isCAASModelFacade",
"(",
"facadeName",
"string",
")",
"bool",
"{",
"return",
"caasModelFacadeNames",
".",
"Contains",
"(",
"facadeName",
")",
"||",
"commonModelFacadeNames",
".",
"Contains",
"(",
"facadeName",
")",
"||",
"commonFacadeNames",
".",
"Contains"... | // isCAASModelFacade reports whether the given facade name can be accessed
// using the controller connection. | [
"isCAASModelFacade",
"reports",
"whether",
"the",
"given",
"facade",
"name",
"can",
"be",
"accessed",
"using",
"the",
"controller",
"connection",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/restrict_caasmodel.go#L94-L98 |
3,476 | juju/juju | cmd/juju/common/errors.go | UserErr | func (e *TermsRequiredError) UserErr() error {
terms := strings.Join(e.Terms, " ")
return errors.Wrap(e,
errors.Errorf(`Declined: some terms require agreement. Try: "juju agree %s"`, terms))
} | go | func (e *TermsRequiredError) UserErr() error {
terms := strings.Join(e.Terms, " ")
return errors.Wrap(e,
errors.Errorf(`Declined: some terms require agreement. Try: "juju agree %s"`, terms))
} | [
"func",
"(",
"e",
"*",
"TermsRequiredError",
")",
"UserErr",
"(",
")",
"error",
"{",
"terms",
":=",
"strings",
".",
"Join",
"(",
"e",
".",
"Terms",
",",
"\"",
"\"",
")",
"\n",
"return",
"errors",
".",
"Wrap",
"(",
"e",
",",
"errors",
".",
"Errorf",... | // UserErr returns an error containing a user-friendly message describing how
// to agree to required terms. | [
"UserErr",
"returns",
"an",
"error",
"containing",
"a",
"user",
"-",
"friendly",
"message",
"describing",
"how",
"to",
"agree",
"to",
"required",
"terms",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/cmd/juju/common/errors.go#L56-L60 |
3,477 | juju/juju | environs/instances/image.go | String | func (ic *InstanceConstraint) String() string {
return fmt.Sprintf(
"{region: %s, series: %s, arches: %s, constraints: %s, storage: %s}",
ic.Region,
ic.Series,
ic.Arches,
ic.Constraints,
ic.Storage,
)
} | go | func (ic *InstanceConstraint) String() string {
return fmt.Sprintf(
"{region: %s, series: %s, arches: %s, constraints: %s, storage: %s}",
ic.Region,
ic.Series,
ic.Arches,
ic.Constraints,
ic.Storage,
)
} | [
"func",
"(",
"ic",
"*",
"InstanceConstraint",
")",
"String",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"ic",
".",
"Region",
",",
"ic",
".",
"Series",
",",
"ic",
".",
"Arches",
",",
"ic",
".",
"Constraints",
","... | // String returns a human readable form of this InstanceConstraint. | [
"String",
"returns",
"a",
"human",
"readable",
"form",
"of",
"this",
"InstanceConstraint",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/environs/instances/image.go#L39-L48 |
3,478 | juju/juju | environs/instances/image.go | match | func (image Image) match(itype InstanceType) imageMatch {
if !image.matchArch(itype.Arches) {
return nonMatch
}
if itype.VirtType == nil || image.VirtType == *itype.VirtType {
return exactMatch
}
if image.VirtType == "" {
// Image doesn't specify virtualisation type. We allow it
// to match, but prefer exa... | go | func (image Image) match(itype InstanceType) imageMatch {
if !image.matchArch(itype.Arches) {
return nonMatch
}
if itype.VirtType == nil || image.VirtType == *itype.VirtType {
return exactMatch
}
if image.VirtType == "" {
// Image doesn't specify virtualisation type. We allow it
// to match, but prefer exa... | [
"func",
"(",
"image",
"Image",
")",
"match",
"(",
"itype",
"InstanceType",
")",
"imageMatch",
"{",
"if",
"!",
"image",
".",
"matchArch",
"(",
"itype",
".",
"Arches",
")",
"{",
"return",
"nonMatch",
"\n",
"}",
"\n",
"if",
"itype",
".",
"VirtType",
"==",... | // match returns true if the image can run on the supplied instance type. | [
"match",
"returns",
"true",
"if",
"the",
"image",
"can",
"run",
"on",
"the",
"supplied",
"instance",
"type",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/environs/instances/image.go#L170-L183 |
3,479 | juju/juju | worker/externalcontrollerupdater/externalcontrollerupdater.go | New | func New(
externalControllers ExternalControllerUpdaterClient,
newExternalControllerWatcherClient NewExternalControllerWatcherClientFunc,
clock clock.Clock,
) (worker.Worker, error) {
w := updaterWorker{
watchExternalControllers: externalControllers.WatchExternalControllers,
externalControllerInfo: ... | go | func New(
externalControllers ExternalControllerUpdaterClient,
newExternalControllerWatcherClient NewExternalControllerWatcherClientFunc,
clock clock.Clock,
) (worker.Worker, error) {
w := updaterWorker{
watchExternalControllers: externalControllers.WatchExternalControllers,
externalControllerInfo: ... | [
"func",
"New",
"(",
"externalControllers",
"ExternalControllerUpdaterClient",
",",
"newExternalControllerWatcherClient",
"NewExternalControllerWatcherClientFunc",
",",
"clock",
"clock",
".",
"Clock",
",",
")",
"(",
"worker",
".",
"Worker",
",",
"error",
")",
"{",
"w",
... | // New returns a new external controller updater worker. | [
"New",
"returns",
"a",
"new",
"external",
"controller",
"updater",
"worker",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/externalcontrollerupdater/externalcontrollerupdater.go#L58-L86 |
3,480 | juju/juju | provider/common/mocks/availability_zone.go | NewMockAvailabilityZone | func NewMockAvailabilityZone(ctrl *gomock.Controller) *MockAvailabilityZone {
mock := &MockAvailabilityZone{ctrl: ctrl}
mock.recorder = &MockAvailabilityZoneMockRecorder{mock}
return mock
} | go | func NewMockAvailabilityZone(ctrl *gomock.Controller) *MockAvailabilityZone {
mock := &MockAvailabilityZone{ctrl: ctrl}
mock.recorder = &MockAvailabilityZoneMockRecorder{mock}
return mock
} | [
"func",
"NewMockAvailabilityZone",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockAvailabilityZone",
"{",
"mock",
":=",
"&",
"MockAvailabilityZone",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockAvailabilityZoneMockR... | // NewMockAvailabilityZone creates a new mock instance | [
"NewMockAvailabilityZone",
"creates",
"a",
"new",
"mock",
"instance"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/availability_zone.go#L24-L28 |
3,481 | juju/juju | provider/common/mocks/availability_zone.go | Available | func (m *MockAvailabilityZone) Available() bool {
ret := m.ctrl.Call(m, "Available")
ret0, _ := ret[0].(bool)
return ret0
} | go | func (m *MockAvailabilityZone) Available() bool {
ret := m.ctrl.Call(m, "Available")
ret0, _ := ret[0].(bool)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockAvailabilityZone",
")",
"Available",
"(",
")",
"bool",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"(",
"bool",
")",
"\n... | // Available mocks base method | [
"Available",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/availability_zone.go#L36-L40 |
3,482 | juju/juju | provider/common/mocks/availability_zone.go | Available | func (mr *MockAvailabilityZoneMockRecorder) Available() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Available", reflect.TypeOf((*MockAvailabilityZone)(nil).Available))
} | go | func (mr *MockAvailabilityZoneMockRecorder) Available() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Available", reflect.TypeOf((*MockAvailabilityZone)(nil).Available))
} | [
"func",
"(",
"mr",
"*",
"MockAvailabilityZoneMockRecorder",
")",
"Available",
"(",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".",
"mock",
",",
"\"",
"\"",
",",
"reflect",
"... | // Available indicates an expected call of Available | [
"Available",
"indicates",
"an",
"expected",
"call",
"of",
"Available"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/availability_zone.go#L43-L45 |
3,483 | juju/juju | apiserver/logsink/mocks/metrics_collector_mock.go | NewMockMetricsCollector | func NewMockMetricsCollector(ctrl *gomock.Controller) *MockMetricsCollector {
mock := &MockMetricsCollector{ctrl: ctrl}
mock.recorder = &MockMetricsCollectorMockRecorder{mock}
return mock
} | go | func NewMockMetricsCollector(ctrl *gomock.Controller) *MockMetricsCollector {
mock := &MockMetricsCollector{ctrl: ctrl}
mock.recorder = &MockMetricsCollectorMockRecorder{mock}
return mock
} | [
"func",
"NewMockMetricsCollector",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockMetricsCollector",
"{",
"mock",
":=",
"&",
"MockMetricsCollector",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockMetricsCollectorMockR... | // NewMockMetricsCollector creates a new mock instance | [
"NewMockMetricsCollector",
"creates",
"a",
"new",
"mock",
"instance"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/logsink/mocks/metrics_collector_mock.go#L25-L29 |
3,484 | juju/juju | apiserver/logsink/mocks/metrics_collector_mock.go | Connections | func (m *MockMetricsCollector) Connections() prometheus.Gauge {
ret := m.ctrl.Call(m, "Connections")
ret0, _ := ret[0].(prometheus.Gauge)
return ret0
} | go | func (m *MockMetricsCollector) Connections() prometheus.Gauge {
ret := m.ctrl.Call(m, "Connections")
ret0, _ := ret[0].(prometheus.Gauge)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockMetricsCollector",
")",
"Connections",
"(",
")",
"prometheus",
".",
"Gauge",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
".",
"... | // Connections mocks base method | [
"Connections",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/logsink/mocks/metrics_collector_mock.go#L37-L41 |
3,485 | juju/juju | apiserver/logsink/mocks/metrics_collector_mock.go | LogReadCount | func (m *MockMetricsCollector) LogReadCount(arg0, arg1 string) prometheus.Counter {
ret := m.ctrl.Call(m, "LogReadCount", arg0, arg1)
ret0, _ := ret[0].(prometheus.Counter)
return ret0
} | go | func (m *MockMetricsCollector) LogReadCount(arg0, arg1 string) prometheus.Counter {
ret := m.ctrl.Call(m, "LogReadCount", arg0, arg1)
ret0, _ := ret[0].(prometheus.Counter)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockMetricsCollector",
")",
"LogReadCount",
"(",
"arg0",
",",
"arg1",
"string",
")",
"prometheus",
".",
"Counter",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
",",
"arg1",
")",
"\... | // LogReadCount mocks base method | [
"LogReadCount",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/logsink/mocks/metrics_collector_mock.go#L49-L53 |
3,486 | juju/juju | apiserver/logsink/mocks/metrics_collector_mock.go | LogReadCount | func (mr *MockMetricsCollectorMockRecorder) LogReadCount(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogReadCount", reflect.TypeOf((*MockMetricsCollector)(nil).LogReadCount), arg0, arg1)
} | go | func (mr *MockMetricsCollectorMockRecorder) LogReadCount(arg0, arg1 interface{}) *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LogReadCount", reflect.TypeOf((*MockMetricsCollector)(nil).LogReadCount), arg0, arg1)
} | [
"func",
"(",
"mr",
"*",
"MockMetricsCollectorMockRecorder",
")",
"LogReadCount",
"(",
"arg0",
",",
"arg1",
"interface",
"{",
"}",
")",
"*",
"gomock",
".",
"Call",
"{",
"return",
"mr",
".",
"mock",
".",
"ctrl",
".",
"RecordCallWithMethodType",
"(",
"mr",
".... | // LogReadCount indicates an expected call of LogReadCount | [
"LogReadCount",
"indicates",
"an",
"expected",
"call",
"of",
"LogReadCount"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/logsink/mocks/metrics_collector_mock.go#L56-L58 |
3,487 | juju/juju | apiserver/logsink/mocks/metrics_collector_mock.go | PingFailureCount | func (m *MockMetricsCollector) PingFailureCount(arg0 string) prometheus.Counter {
ret := m.ctrl.Call(m, "PingFailureCount", arg0)
ret0, _ := ret[0].(prometheus.Counter)
return ret0
} | go | func (m *MockMetricsCollector) PingFailureCount(arg0 string) prometheus.Counter {
ret := m.ctrl.Call(m, "PingFailureCount", arg0)
ret0, _ := ret[0].(prometheus.Counter)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockMetricsCollector",
")",
"PingFailureCount",
"(",
"arg0",
"string",
")",
"prometheus",
".",
"Counter",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret0",
",",
"_",
... | // PingFailureCount mocks base method | [
"PingFailureCount",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/logsink/mocks/metrics_collector_mock.go#L73-L77 |
3,488 | juju/juju | apiserver/logsink/mocks/metrics_collector_mock.go | TotalConnections | func (m *MockMetricsCollector) TotalConnections() prometheus.Counter {
ret := m.ctrl.Call(m, "TotalConnections")
ret0, _ := ret[0].(prometheus.Counter)
return ret0
} | go | func (m *MockMetricsCollector) TotalConnections() prometheus.Counter {
ret := m.ctrl.Call(m, "TotalConnections")
ret0, _ := ret[0].(prometheus.Counter)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockMetricsCollector",
")",
"TotalConnections",
"(",
")",
"prometheus",
".",
"Counter",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
")",
"\n",
"ret0",
",",
"_",
":=",
"ret",
"[",
"0",
"]",
"... | // TotalConnections mocks base method | [
"TotalConnections",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/apiserver/logsink/mocks/metrics_collector_mock.go#L85-L89 |
3,489 | juju/juju | worker/applicationscaler/shim.go | NewFacade | func NewFacade(apiCaller base.APICaller) (Facade, error) {
return applicationscaler.NewAPI(
apiCaller,
watcher.NewStringsWatcher,
), nil
} | go | func NewFacade(apiCaller base.APICaller) (Facade, error) {
return applicationscaler.NewAPI(
apiCaller,
watcher.NewStringsWatcher,
), nil
} | [
"func",
"NewFacade",
"(",
"apiCaller",
"base",
".",
"APICaller",
")",
"(",
"Facade",
",",
"error",
")",
"{",
"return",
"applicationscaler",
".",
"NewAPI",
"(",
"apiCaller",
",",
"watcher",
".",
"NewStringsWatcher",
",",
")",
",",
"nil",
"\n",
"}"
] | // NewFacade creates a Facade from a base.APICaller.
// It's a sensible value for ManifoldConfig.NewFacade. | [
"NewFacade",
"creates",
"a",
"Facade",
"from",
"a",
"base",
".",
"APICaller",
".",
"It",
"s",
"a",
"sensible",
"value",
"for",
"ManifoldConfig",
".",
"NewFacade",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/applicationscaler/shim.go#L14-L19 |
3,490 | juju/juju | worker/raft/rafttransport/streamlayer.go | Close | func (l *streamLayer) Close() error {
l.tomb.Kill(nil)
return l.tomb.Wait()
} | go | func (l *streamLayer) Close() error {
l.tomb.Kill(nil)
return l.tomb.Wait()
} | [
"func",
"(",
"l",
"*",
"streamLayer",
")",
"Close",
"(",
")",
"error",
"{",
"l",
".",
"tomb",
".",
"Kill",
"(",
"nil",
")",
"\n",
"return",
"l",
".",
"tomb",
".",
"Wait",
"(",
")",
"\n",
"}"
] | // Close closes the layer. | [
"Close",
"closes",
"the",
"layer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/raft/rafttransport/streamlayer.go#L108-L111 |
3,491 | juju/juju | worker/raft/rafttransport/streamlayer.go | Addr | func (l *streamLayer) Addr() net.Addr {
select {
case <-l.tomb.Dying():
return invalidAddr
case <-l.clock.After(AddrTimeout):
logger.Errorf("streamLayer.Addr timed out waiting for API address")
// Stop this (and parent) worker.
l.tomb.Kill(ErrAddressTimeout)
return invalidAddr
case addr := <-l.addr:
ret... | go | func (l *streamLayer) Addr() net.Addr {
select {
case <-l.tomb.Dying():
return invalidAddr
case <-l.clock.After(AddrTimeout):
logger.Errorf("streamLayer.Addr timed out waiting for API address")
// Stop this (and parent) worker.
l.tomb.Kill(ErrAddressTimeout)
return invalidAddr
case addr := <-l.addr:
ret... | [
"func",
"(",
"l",
"*",
"streamLayer",
")",
"Addr",
"(",
")",
"net",
".",
"Addr",
"{",
"select",
"{",
"case",
"<-",
"l",
".",
"tomb",
".",
"Dying",
"(",
")",
":",
"return",
"invalidAddr",
"\n",
"case",
"<-",
"l",
".",
"clock",
".",
"After",
"(",
... | // Addr returns the local address for the layer. | [
"Addr",
"returns",
"the",
"local",
"address",
"for",
"the",
"layer",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/worker/raft/rafttransport/streamlayer.go#L116-L128 |
3,492 | juju/juju | component/all/resource.go | registerForServer | func (r resources) registerForServer() error {
r.registerState()
r.registerAgentWorkers()
r.registerHookContext()
return nil
} | go | func (r resources) registerForServer() error {
r.registerState()
r.registerAgentWorkers()
r.registerHookContext()
return nil
} | [
"func",
"(",
"r",
"resources",
")",
"registerForServer",
"(",
")",
"error",
"{",
"r",
".",
"registerState",
"(",
")",
"\n",
"r",
".",
"registerAgentWorkers",
"(",
")",
"\n",
"r",
".",
"registerHookContext",
"(",
")",
"\n",
"return",
"nil",
"\n",
"}"
] | // RegisterForServer is the top-level registration method
// for the component in a jujud context. | [
"RegisterForServer",
"is",
"the",
"top",
"-",
"level",
"registration",
"method",
"for",
"the",
"component",
"in",
"a",
"jujud",
"context",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/component/all/resource.go#L28-L33 |
3,493 | juju/juju | component/all/resource.go | registerAgentWorkers | func (r resources) registerAgentWorkers() {
if !markRegistered(resource.ComponentName, "agent-workers") {
return
}
charmrevisionupdater.RegisterLatestCharmHandler("resources", resourceadapters.NewLatestCharmHandler)
} | go | func (r resources) registerAgentWorkers() {
if !markRegistered(resource.ComponentName, "agent-workers") {
return
}
charmrevisionupdater.RegisterLatestCharmHandler("resources", resourceadapters.NewLatestCharmHandler)
} | [
"func",
"(",
"r",
"resources",
")",
"registerAgentWorkers",
"(",
")",
"{",
"if",
"!",
"markRegistered",
"(",
"resource",
".",
"ComponentName",
",",
"\"",
"\"",
")",
"{",
"return",
"\n",
"}",
"\n\n",
"charmrevisionupdater",
".",
"RegisterLatestCharmHandler",
"(... | // registerAgentWorkers adds the resources workers to the agents. | [
"registerAgentWorkers",
"adds",
"the",
"resources",
"workers",
"to",
"the",
"agents",
"."
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/component/all/resource.go#L44-L50 |
3,494 | juju/juju | provider/common/mocks/zoned_environ.go | NewMockZonedEnviron | func NewMockZonedEnviron(ctrl *gomock.Controller) *MockZonedEnviron {
mock := &MockZonedEnviron{ctrl: ctrl}
mock.recorder = &MockZonedEnvironMockRecorder{mock}
return mock
} | go | func NewMockZonedEnviron(ctrl *gomock.Controller) *MockZonedEnviron {
mock := &MockZonedEnviron{ctrl: ctrl}
mock.recorder = &MockZonedEnvironMockRecorder{mock}
return mock
} | [
"func",
"NewMockZonedEnviron",
"(",
"ctrl",
"*",
"gomock",
".",
"Controller",
")",
"*",
"MockZonedEnviron",
"{",
"mock",
":=",
"&",
"MockZonedEnviron",
"{",
"ctrl",
":",
"ctrl",
"}",
"\n",
"mock",
".",
"recorder",
"=",
"&",
"MockZonedEnvironMockRecorder",
"{",... | // NewMockZonedEnviron creates a new mock instance | [
"NewMockZonedEnviron",
"creates",
"a",
"new",
"mock",
"instance"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/zoned_environ.go#L33-L37 |
3,495 | juju/juju | provider/common/mocks/zoned_environ.go | AdoptResources | func (m *MockZonedEnviron) AdoptResources(arg0 context.ProviderCallContext, arg1 string, arg2 version.Number) error {
ret := m.ctrl.Call(m, "AdoptResources", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockZonedEnviron) AdoptResources(arg0 context.ProviderCallContext, arg1 string, arg2 version.Number) error {
ret := m.ctrl.Call(m, "AdoptResources", arg0, arg1, arg2)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockZonedEnviron",
")",
"AdoptResources",
"(",
"arg0",
"context",
".",
"ProviderCallContext",
",",
"arg1",
"string",
",",
"arg2",
"version",
".",
"Number",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
... | // AdoptResources mocks base method | [
"AdoptResources",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/zoned_environ.go#L45-L49 |
3,496 | juju/juju | provider/common/mocks/zoned_environ.go | AvailabilityZones | func (m *MockZonedEnviron) AvailabilityZones(arg0 context.ProviderCallContext) ([]common.AvailabilityZone, error) {
ret := m.ctrl.Call(m, "AvailabilityZones", arg0)
ret0, _ := ret[0].([]common.AvailabilityZone)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockZonedEnviron) AvailabilityZones(arg0 context.ProviderCallContext) ([]common.AvailabilityZone, error) {
ret := m.ctrl.Call(m, "AvailabilityZones", arg0)
ret0, _ := ret[0].([]common.AvailabilityZone)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockZonedEnviron",
")",
"AvailabilityZones",
"(",
"arg0",
"context",
".",
"ProviderCallContext",
")",
"(",
"[",
"]",
"common",
".",
"AvailabilityZone",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
... | // AvailabilityZones mocks base method | [
"AvailabilityZones",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/zoned_environ.go#L70-L75 |
3,497 | juju/juju | provider/common/mocks/zoned_environ.go | ConstraintsValidator | func (m *MockZonedEnviron) ConstraintsValidator(arg0 context.ProviderCallContext) (constraints.Validator, error) {
ret := m.ctrl.Call(m, "ConstraintsValidator", arg0)
ret0, _ := ret[0].(constraints.Validator)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockZonedEnviron) ConstraintsValidator(arg0 context.ProviderCallContext) (constraints.Validator, error) {
ret := m.ctrl.Call(m, "ConstraintsValidator", arg0)
ret0, _ := ret[0].(constraints.Validator)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockZonedEnviron",
")",
"ConstraintsValidator",
"(",
"arg0",
"context",
".",
"ProviderCallContext",
")",
"(",
"constraints",
".",
"Validator",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\""... | // ConstraintsValidator mocks base method | [
"ConstraintsValidator",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/zoned_environ.go#L108-L113 |
3,498 | juju/juju | provider/common/mocks/zoned_environ.go | DeriveAvailabilityZones | func (m *MockZonedEnviron) DeriveAvailabilityZones(arg0 context.ProviderCallContext, arg1 environs.StartInstanceParams) ([]string, error) {
ret := m.ctrl.Call(m, "DeriveAvailabilityZones", arg0, arg1)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | go | func (m *MockZonedEnviron) DeriveAvailabilityZones(arg0 context.ProviderCallContext, arg1 environs.StartInstanceParams) ([]string, error) {
ret := m.ctrl.Call(m, "DeriveAvailabilityZones", arg0, arg1)
ret0, _ := ret[0].([]string)
ret1, _ := ret[1].(error)
return ret0, ret1
} | [
"func",
"(",
"m",
"*",
"MockZonedEnviron",
")",
"DeriveAvailabilityZones",
"(",
"arg0",
"context",
".",
"ProviderCallContext",
",",
"arg1",
"environs",
".",
"StartInstanceParams",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"ret",
":=",
"m",
".",
... | // DeriveAvailabilityZones mocks base method | [
"DeriveAvailabilityZones",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/zoned_environ.go#L146-L151 |
3,499 | juju/juju | provider/common/mocks/zoned_environ.go | Destroy | func (m *MockZonedEnviron) Destroy(arg0 context.ProviderCallContext) error {
ret := m.ctrl.Call(m, "Destroy", arg0)
ret0, _ := ret[0].(error)
return ret0
} | go | func (m *MockZonedEnviron) Destroy(arg0 context.ProviderCallContext) error {
ret := m.ctrl.Call(m, "Destroy", arg0)
ret0, _ := ret[0].(error)
return ret0
} | [
"func",
"(",
"m",
"*",
"MockZonedEnviron",
")",
"Destroy",
"(",
"arg0",
"context",
".",
"ProviderCallContext",
")",
"error",
"{",
"ret",
":=",
"m",
".",
"ctrl",
".",
"Call",
"(",
"m",
",",
"\"",
"\"",
",",
"arg0",
")",
"\n",
"ret0",
",",
"_",
":=",... | // Destroy mocks base method | [
"Destroy",
"mocks",
"base",
"method"
] | ba728eedb1e44937c7bdc59f374b06400d0c7133 | https://github.com/juju/juju/blob/ba728eedb1e44937c7bdc59f374b06400d0c7133/provider/common/mocks/zoned_environ.go#L159-L163 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.