Documentation ¶
Index ¶
- type ActionHook
- type Context
- type ContextActionHook
- func (c *ContextActionHook) ActionParams() (map[string]interface{}, error)
- func (c *ContextActionHook) LogActionMessage(_ context.Context, message string) error
- func (c *ContextActionHook) SetActionFailed() error
- func (c *ContextActionHook) SetActionMessage(message string) error
- func (c *ContextActionHook) UpdateActionResults(keys []string, value interface{}) error
- type ContextInfo
- type ContextInstance
- type ContextLeader
- type ContextNetworking
- func (c *ContextNetworking) ClosePortRange(endpoint string, portRange network.PortRange) error
- func (c *ContextNetworking) NetworkInfo(_ context.Context, bindingNames []string, relationId int) (map[string]params.NetworkInfoResult, error)
- func (c *ContextNetworking) OpenPortRange(endpoint string, portRange network.PortRange) error
- func (c *ContextNetworking) OpenedPortRanges() network.GroupedPortRanges
- func (c *ContextNetworking) PrivateAddress() (string, error)
- func (c *ContextNetworking) PublicAddress(_ context.Context) (string, error)
- type ContextPayloads
- func (c *ContextPayloads) FlushPayloads(_ context.Context) error
- func (c *ContextPayloads) GetPayload(class, id string) (*payloads.Payload, error)
- func (c *ContextPayloads) ListPayloads() ([]string, error)
- func (c *ContextPayloads) SetPayloadStatus(_ context.Context, class, id, status string) error
- func (c *ContextPayloads) TrackPayload(payload payloads.Payload) error
- func (c *ContextPayloads) UntrackPayload(_ context.Context, class, id string) error
- type ContextRelation
- func (r *ContextRelation) ApplicationSettings(context.Context) (jujuc.Settings, error)
- func (r *ContextRelation) FakeId() string
- func (r *ContextRelation) Id() int
- func (r *ContextRelation) Life() life.Value
- func (r *ContextRelation) Name() string
- func (r *ContextRelation) ReadApplicationSettings(_ context.Context, name string) (params.Settings, error)
- func (r *ContextRelation) ReadSettings(_ context.Context, name string) (params.Settings, error)
- func (r *ContextRelation) RelationTag() names.RelationTag
- func (r *ContextRelation) RemoteApplicationName() string
- func (r *ContextRelation) SetStatus(_ context.Context, status relation.Status) error
- func (r *ContextRelation) Settings(_ context.Context) (jujuc.Settings, error)
- func (r *ContextRelation) Suspended() bool
- func (r *ContextRelation) UnitNames() []string
- type ContextRelationHook
- type ContextRelations
- type ContextResources
- type ContextSecrets
- func (c *ContextSecrets) CreateSecret(_ context.Context, args *jujuc.SecretCreateArgs) (*secrets.URI, error)
- func (c *ContextSecrets) GetSecret(_ context.Context, uri *secrets.URI, label string, refresh, peek bool) (secrets.SecretValue, error)
- func (c *ContextSecrets) GrantSecret(uri *secrets.URI, args *jujuc.SecretGrantRevokeArgs) error
- func (c *ContextSecrets) RemoveSecret(uri *secrets.URI, revision *int) error
- func (c *ContextSecrets) RevokeSecret(uri *secrets.URI, args *jujuc.SecretGrantRevokeArgs) error
- func (c *ContextSecrets) SecretMetadata() (map[string]jujuc.SecretMetadata, error)
- func (c *ContextSecrets) UpdateSecret(uri *secrets.URI, args *jujuc.SecretUpdateArgs) error
- type ContextStatus
- func (c *ContextStatus) ApplicationStatus(context.Context) (jujuc.ApplicationStatusInfo, error)
- func (c *ContextStatus) SetApplicationStatus(_ context.Context, status jujuc.StatusInfo) error
- func (c *ContextStatus) SetUnitStatus(_ context.Context, status jujuc.StatusInfo) error
- func (c *ContextStatus) UnitStatus(context.Context) (*jujuc.StatusInfo, error)
- type ContextStorage
- func (c *ContextStorage) AddUnitStorage(all map[string]params.StorageDirectives) error
- func (c *ContextStorage) HookStorage(ctx context.Context) (jujuc.ContextStorageAttachment, error)
- func (c *ContextStorage) Storage(_ context.Context, tag names.StorageTag) (jujuc.ContextStorageAttachment, error)
- func (c *ContextStorage) StorageTags(_ context.Context) ([]names.StorageTag, error)
- type ContextStorageAttachment
- type ContextSuite
- type ContextUnit
- type ContextUnitCharmState
- func (c *ContextUnitCharmState) DeleteCharmStateValue(_ context.Context, key string) error
- func (c *ContextUnitCharmState) GetCharmState(_ context.Context) (map[string]string, error)
- func (c *ContextUnitCharmState) GetCharmStateValue(_ context.Context, key string) (string, error)
- func (c *ContextUnitCharmState) SetCharmStateValue(_ context.Context, key string, value string) error
- type ContextVersion
- type ContextWorkloadHook
- type Instance
- type Leadership
- type NetworkInterface
- type Relation
- type RelationHook
- type Relations
- func (r *Relations) Reset()
- func (r *Relations) SetNewRelation(id int, name string, stub *testing.Stub) *Relation
- func (r *Relations) SetNewRelationWithLife(id int, name string, life life.Value, stub *testing.Stub) *Relation
- func (r *Relations) SetRelated(id int, unit string, settings Settings)
- func (r *Relations) SetRelation(id int, relCtx jujuc.ContextRelation)
- type Settings
- type Status
- type Storage
- func (s *Storage) AddUnitStorage(all map[string]params.StorageDirectives)
- func (s *Storage) SetAttachment(attach jujuc.ContextStorageAttachment)
- func (s *Storage) SetBlockStorage(name, location string, stub *testing.Stub)
- func (s *Storage) SetNewAttachment(name, location string, kind storage.StorageKind, stub *testing.Stub)
- func (s *Storage) SetStorageTag(id string)
- func (s *Storage) SetUnitStorage(name string, constraints params.StorageDirectives)
- type StorageAttachment
- type Unit
- type UnitCharmState
- type Version
- type WorkloadHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionHook ¶
type ActionHook struct {
ActionParams map[string]interface{}
}
ActionHook holds the values for the hook context.
type Context ¶
type Context struct { ContextUnit ContextUnitCharmState ContextStatus ContextInstance ContextNetworking ContextLeader ContextStorage ContextResources ContextPayloads ContextRelations ContextRelationHook ContextActionHook ContextVersion ContextWorkloadHook ContextSecrets }
Context is a test double for jujuc.Context.
func NewContext ¶
func NewContext(stub *testing.Stub, info *ContextInfo) *Context
NewContext builds a jujuc.Context test double.
type ContextActionHook ¶
type ContextActionHook struct {
// contains filtered or unexported fields
}
ContextActionHook is a test double for jujuc.ActionHookContext.
func (*ContextActionHook) ActionParams ¶
func (c *ContextActionHook) ActionParams() (map[string]interface{}, error)
ActionParams implements jujuc.ActionHookContext.
func (*ContextActionHook) LogActionMessage ¶
func (c *ContextActionHook) LogActionMessage(_ context.Context, message string) error
LogActionMessage implements jujuc.ActionHookContext.
func (*ContextActionHook) SetActionFailed ¶
func (c *ContextActionHook) SetActionFailed() error
SetActionFailed implements jujuc.ActionHookContext.
func (*ContextActionHook) SetActionMessage ¶
func (c *ContextActionHook) SetActionMessage(message string) error
SetActionMessage implements jujuc.ActionHookContext.
func (*ContextActionHook) UpdateActionResults ¶
func (c *ContextActionHook) UpdateActionResults(keys []string, value interface{}) error
UpdateActionResults implements jujuc.ActionHookContext.
type ContextInfo ¶
type ContextInfo struct { Unit UnitCharmState Status Instance NetworkInterface Leadership Storage Relations RelationHook ActionHook Version WorkloadHook }
ContextInfo holds the values for the hook context.
func (*ContextInfo) Context ¶
func (info *ContextInfo) Context(stub *testing.Stub) *Context
Context returns a Context that wraps the info.
func (*ContextInfo) SetAsActionHook ¶
func (info *ContextInfo) SetAsActionHook()
SetAsActionHook updates the context to work as an action hook context.
func (*ContextInfo) SetAsRelationHook ¶
func (info *ContextInfo) SetAsRelationHook(id int, remote string)
SetAsRelationHook updates the context to work as a relation hook context.
func (*ContextInfo) SetRemoteApplicationName ¶
func (info *ContextInfo) SetRemoteApplicationName(remote string)
SetRemoteApplicationName defines the remote application
type ContextInstance ¶
type ContextInstance struct {
// contains filtered or unexported fields
}
ContextInstance is a test double for jujuc.ContextInstance.
func (*ContextInstance) AvailabilityZone ¶
func (c *ContextInstance) AvailabilityZone() (string, error)
AvailabilityZone implements jujuc.ContextInstance.
func (*ContextInstance) RequestReboot ¶
func (c *ContextInstance) RequestReboot(priority jujuc.RebootPriority) error
RequestReboot implements jujuc.ContextInstance.
type ContextLeader ¶
type ContextLeader struct {
// contains filtered or unexported fields
}
ContextLeader is a test double for jujuc.ContextLeader.
func (*ContextLeader) IsLeader ¶
func (c *ContextLeader) IsLeader() (bool, error)
IsLeader implements jujuc.ContextLeader.
func (*ContextLeader) LeaderSettings ¶
LeaderSettings implements jujuc.ContextLeader.
func (*ContextLeader) WriteLeaderSettings ¶
WriteLeaderSettings implements jujuc.ContextLeader.
type ContextNetworking ¶
type ContextNetworking struct {
// contains filtered or unexported fields
}
ContextNetworking is a test double for jujuc.ContextNetworking.
func (*ContextNetworking) ClosePortRange ¶
func (c *ContextNetworking) ClosePortRange(endpoint string, portRange network.PortRange) error
ClosePortRange implements jujuc.ContextNetworking.
func (*ContextNetworking) NetworkInfo ¶
func (c *ContextNetworking) NetworkInfo(_ context.Context, bindingNames []string, relationId int) (map[string]params.NetworkInfoResult, error)
NetworkInfo implements jujuc.ContextNetworking.
func (*ContextNetworking) OpenPortRange ¶
func (c *ContextNetworking) OpenPortRange(endpoint string, portRange network.PortRange) error
OpenPortRange implements jujuc.ContextNetworking.
func (*ContextNetworking) OpenedPortRanges ¶
func (c *ContextNetworking) OpenedPortRanges() network.GroupedPortRanges
OpenedPortRanges implements jujuc.ContextNetworking.
func (*ContextNetworking) PrivateAddress ¶
func (c *ContextNetworking) PrivateAddress() (string, error)
PrivateAddress implements jujuc.ContextNetworking.
func (*ContextNetworking) PublicAddress ¶
func (c *ContextNetworking) PublicAddress(_ context.Context) (string, error)
PublicAddress implements jujuc.ContextNetworking.
type ContextPayloads ¶
type ContextPayloads struct {
// contains filtered or unexported fields
}
ContextPayloads is a test double for jujuc.ContextResources.
func (*ContextPayloads) FlushPayloads ¶
func (c *ContextPayloads) FlushPayloads(_ context.Context) error
FlushPayloads implements jujuc.ContextPayloads.
func (*ContextPayloads) GetPayload ¶
func (c *ContextPayloads) GetPayload(class, id string) (*payloads.Payload, error)
GetPayload implements jujuc.ContextPayloads.
func (*ContextPayloads) ListPayloads ¶
func (c *ContextPayloads) ListPayloads() ([]string, error)
ListPayloads implements jujuc.ContextPayloads.
func (*ContextPayloads) SetPayloadStatus ¶
func (c *ContextPayloads) SetPayloadStatus(_ context.Context, class, id, status string) error
SetPayloadStatus implements jujuc.ContextPayloads.
func (*ContextPayloads) TrackPayload ¶
func (c *ContextPayloads) TrackPayload(payload payloads.Payload) error
TrackPayload implements jujuc.ContextPayloads.
func (*ContextPayloads) UntrackPayload ¶
func (c *ContextPayloads) UntrackPayload(_ context.Context, class, id string) error
UntrackPayload implements jujuc.ContextPayloads.
type ContextRelation ¶
type ContextRelation struct {
// contains filtered or unexported fields
}
ContextRelation is a test double for jujuc.ContextRelation.
func (*ContextRelation) ApplicationSettings ¶
ApplicationSettings implements jujuc.ContextRelation.
func (*ContextRelation) FakeId ¶
func (r *ContextRelation) FakeId() string
FakeId implements jujuc.ContextRelation.
func (*ContextRelation) Id ¶
func (r *ContextRelation) Id() int
Id implements jujuc.ContextRelation.
func (*ContextRelation) Life ¶
func (r *ContextRelation) Life() life.Value
Life implements jujuc.ContextRelation.
func (*ContextRelation) Name ¶
func (r *ContextRelation) Name() string
Name implements jujuc.ContextRelation.
func (*ContextRelation) ReadApplicationSettings ¶
func (r *ContextRelation) ReadApplicationSettings(_ context.Context, name string) (params.Settings, error)
ReadApplicationSettings implements jujuc.ContextRelation.
func (*ContextRelation) ReadSettings ¶
ReadSettings implements jujuc.ContextRelation.
func (*ContextRelation) RelationTag ¶
func (r *ContextRelation) RelationTag() names.RelationTag
RelationTag implements jujuc.ContextRelation.
func (*ContextRelation) RemoteApplicationName ¶
func (r *ContextRelation) RemoteApplicationName() string
RemoteApplicationName implements jujuc.ContextRelation.
func (*ContextRelation) Suspended ¶
func (r *ContextRelation) Suspended() bool
Suspended implements jujuc.ContextRelation.
func (*ContextRelation) UnitNames ¶
func (r *ContextRelation) UnitNames() []string
UnitNames implements jujuc.ContextRelation.
type ContextRelationHook ¶
type ContextRelationHook struct {
// contains filtered or unexported fields
}
ContextRelationHook is a test double for jujuc.RelationHookContext.
func (*ContextRelationHook) HookRelation ¶
func (c *ContextRelationHook) HookRelation() (jujuc.ContextRelation, error)
HookRelation implements jujuc.RelationHookContext.
func (*ContextRelationHook) RemoteApplicationName ¶
func (c *ContextRelationHook) RemoteApplicationName() (string, error)
RemoteApplicationName implements jujuc.RelationHookContext.
func (*ContextRelationHook) RemoteUnitName ¶
func (c *ContextRelationHook) RemoteUnitName() (string, error)
RemoteUnitName implements jujuc.RelationHookContext.
type ContextRelations ¶
type ContextRelations struct {
// contains filtered or unexported fields
}
ContextRelations is a test double for jujuc.ContextRelations.
func (*ContextRelations) DownloadResource ¶
DownloadResource implements jujuc.ContextResources.
func (*ContextRelations) Relation ¶
func (c *ContextRelations) Relation(id int) (jujuc.ContextRelation, error)
Relation implements jujuc.ContextRelations.
func (*ContextRelations) RelationIds ¶
func (c *ContextRelations) RelationIds() ([]int, error)
RelationIds implements jujuc.ContextRelations.
type ContextResources ¶
type ContextResources struct {
// contains filtered or unexported fields
}
ContextResources is a test double for jujuc.ContextResources.
type ContextSecrets ¶
type ContextSecrets struct { SecretValue secrets.SecretValue Access []secrets.AccessInfo // contains filtered or unexported fields }
ContextSecrets is a test double for jujuc.ContextSecrets.
func (*ContextSecrets) CreateSecret ¶
func (c *ContextSecrets) CreateSecret(_ context.Context, args *jujuc.SecretCreateArgs) (*secrets.URI, error)
CreateSecret implements jujuc.ContextSecrets.
func (*ContextSecrets) GetSecret ¶
func (c *ContextSecrets) GetSecret(_ context.Context, uri *secrets.URI, label string, refresh, peek bool) (secrets.SecretValue, error)
GetSecret implements jujuc.ContextSecrets.
func (*ContextSecrets) GrantSecret ¶
func (c *ContextSecrets) GrantSecret(uri *secrets.URI, args *jujuc.SecretGrantRevokeArgs) error
GrantSecret implements jujuc.ContextSecrets.
func (*ContextSecrets) RemoveSecret ¶
func (c *ContextSecrets) RemoveSecret(uri *secrets.URI, revision *int) error
RemoveSecret implements jujuc.ContextSecrets.
func (*ContextSecrets) RevokeSecret ¶
func (c *ContextSecrets) RevokeSecret(uri *secrets.URI, args *jujuc.SecretGrantRevokeArgs) error
RevokeSecret implements jujuc.ContextSecrets.
func (*ContextSecrets) SecretMetadata ¶
func (c *ContextSecrets) SecretMetadata() (map[string]jujuc.SecretMetadata, error)
SecretMetadata gets the metadata for secrets created by the charm.
func (*ContextSecrets) UpdateSecret ¶
func (c *ContextSecrets) UpdateSecret(uri *secrets.URI, args *jujuc.SecretUpdateArgs) error
UpdateSecret implements jujuc.ContextSecrets.
type ContextStatus ¶
type ContextStatus struct {
// contains filtered or unexported fields
}
ContextStatus is a test double for jujuc.ContextStatus.
func (*ContextStatus) ApplicationStatus ¶
func (c *ContextStatus) ApplicationStatus(context.Context) (jujuc.ApplicationStatusInfo, error)
ApplicationStatus implements jujuc.ContextStatus.
func (*ContextStatus) SetApplicationStatus ¶
func (c *ContextStatus) SetApplicationStatus(_ context.Context, status jujuc.StatusInfo) error
SetApplicationStatus implements jujuc.ContextStatus.
func (*ContextStatus) SetUnitStatus ¶
func (c *ContextStatus) SetUnitStatus(_ context.Context, status jujuc.StatusInfo) error
SetUnitStatus implements jujuc.ContextStatus.
func (*ContextStatus) UnitStatus ¶
func (c *ContextStatus) UnitStatus(context.Context) (*jujuc.StatusInfo, error)
UnitStatus implements jujuc.ContextStatus.
type ContextStorage ¶
type ContextStorage struct {
// contains filtered or unexported fields
}
ContextStorage is a test double for jujuc.ContextStorage.
func (*ContextStorage) AddUnitStorage ¶
func (c *ContextStorage) AddUnitStorage(all map[string]params.StorageDirectives) error
AddUnitStorage implements jujuc.ContextStorage.
func (*ContextStorage) HookStorage ¶
func (c *ContextStorage) HookStorage(ctx context.Context) (jujuc.ContextStorageAttachment, error)
HookStorage implements jujuc.ContextStorage.
func (*ContextStorage) Storage ¶
func (c *ContextStorage) Storage(_ context.Context, tag names.StorageTag) (jujuc.ContextStorageAttachment, error)
Storage implements jujuc.ContextStorage.
func (*ContextStorage) StorageTags ¶
func (c *ContextStorage) StorageTags(_ context.Context) ([]names.StorageTag, error)
StorageTags implements jujuc.ContextStorage.
type ContextStorageAttachment ¶
type ContextStorageAttachment struct {
// contains filtered or unexported fields
}
ContextStorageAttachment is a test double for jujuc.ContextStorageAttachment.
func (*ContextStorageAttachment) Kind ¶
func (c *ContextStorageAttachment) Kind() storage.StorageKind
Kind implements jujuc.StorageAttachement.
func (*ContextStorageAttachment) Location ¶
func (c *ContextStorageAttachment) Location() string
Location implements jujuc.StorageAttachement.
func (*ContextStorageAttachment) Tag ¶
func (c *ContextStorageAttachment) Tag() names.StorageTag
Tag implements jujuc.StorageAttachement.
type ContextSuite ¶
ContextSuite is the base suite for testing jujuc.Context-related code.
func (*ContextSuite) NewHookContext ¶
func (s *ContextSuite) NewHookContext() (*Context, *ContextInfo)
NewHookContext builds a jujuc.Context test double.
func (*ContextSuite) NewInfo ¶
func (s *ContextSuite) NewInfo() *ContextInfo
NewInfo builds a ContextInfo with basic default data.
func (*ContextSuite) SetUpTest ¶
func (s *ContextSuite) SetUpTest(c *gc.C)
type ContextUnit ¶
type ContextUnit struct {
// contains filtered or unexported fields
}
ContextUnit is a test double for jujuc.ContextUnit.
func (*ContextUnit) ConfigSettings ¶
ConfigSettings implements jujuc.ContextUnit.
func (*ContextUnit) GoalState ¶
func (c *ContextUnit) GoalState(context.Context) (*application.GoalState, error)
GoalState implements jujuc.ContextUnit.
func (*ContextUnit) UnitName ¶
func (c *ContextUnit) UnitName() string
UnitName implements jujuc.ContextUnit.
type ContextUnitCharmState ¶
type ContextUnitCharmState struct {
// contains filtered or unexported fields
}
ContextUnitCharmState is a test double for jujuc.unitCharmStateContext.
func (*ContextUnitCharmState) DeleteCharmStateValue ¶
func (c *ContextUnitCharmState) DeleteCharmStateValue(_ context.Context, key string) error
DeleteCharmStateValue implements jujuc.unitCharmStateContext.
func (*ContextUnitCharmState) GetCharmState ¶
GetCharmState implements jujuc.unitCharmStateContext.
func (*ContextUnitCharmState) GetCharmStateValue ¶
GetCharmStateValue implements jujuc.unitCharmStateContext.
func (*ContextUnitCharmState) SetCharmStateValue ¶
func (c *ContextUnitCharmState) SetCharmStateValue(_ context.Context, key string, value string) error
SetCharmStateValue implements jujuc.unitCharmStateContext.
type ContextVersion ¶
type ContextVersion struct {
// contains filtered or unexported fields
}
ContextVersion is a test double for jujuc.ContextVersion.
func (*ContextVersion) SetUnitWorkloadVersion ¶
func (c *ContextVersion) SetUnitWorkloadVersion(_ context.Context, version string) error
SetUnitWorkloadVersion implements jujuc.ContextVersion.
func (*ContextVersion) UnitWorkloadVersion ¶
func (c *ContextVersion) UnitWorkloadVersion(_ context.Context) (string, error)
UnitWorkloadVersion implements jujuc.ContextVersion.
type ContextWorkloadHook ¶
type ContextWorkloadHook struct {
// contains filtered or unexported fields
}
ContextWorkloadHook is a test double for jujuc.WorkloadHookContext.
func (*ContextWorkloadHook) WorkloadName ¶
func (c *ContextWorkloadHook) WorkloadName() (string, error)
WorkloadName implements jujuc.WorkloadHookContext.
type Instance ¶
type Instance struct { AvailabilityZone string RebootPriority *jujuc.RebootPriority }
Instance holds the values for the hook context.
type Leadership ¶
Leadership holds the values for the hook context.
type NetworkInterface ¶
type NetworkInterface struct { PublicAddress string PrivateAddress string PortRangesByEndpoint network.GroupedPortRanges NetworkInfoResults map[string]params.NetworkInfoResult }
NetworkInterface holds the values for the hook context.
func (*NetworkInterface) AddPortRange ¶
func (ni *NetworkInterface) AddPortRange(endpoint string, portRange network.PortRange)
AddPortRanges adds the specified port range.
func (*NetworkInterface) CheckPortRanges ¶
func (ni *NetworkInterface) CheckPortRanges(c *gc.C, expected network.GroupedPortRanges)
CheckPorts checks the current ports.
func (*NetworkInterface) RemovePortRange ¶
func (ni *NetworkInterface) RemovePortRange(endpoint string, portRange network.PortRange)
RemovePortRange removes the specified port range.
type Relation ¶
type Relation struct { // Id is data for jujuc.ContextRelation. Id int // Name is data for jujuc.ContextRelation. Name string // Units is data for jujuc.ContextRelation. Units map[string]Settings // UnitName is data for jujuc.ContextRelation. UnitName string // RemoteApplicationSettings is data for jujuc.ContextRelation RemoteApplicationSettings Settings // LocalApplicationSettings is data for jujuc.ContextRelation LocalApplicationSettings Settings // RemoteApplicationName is data for jujuc.ContextRelation RemoteApplicationName string // The current life value. Life life.Value }
Relation holds the data for the test double.
func (*Relation) SetLocalApplicationSettings ¶
SetLocalApplicationSettings sets the settings for the local application.
func (*Relation) SetRelated ¶
SetRelated adds the relation settings for the unit.
func (*Relation) SetRemoteApplicationSettings ¶
SetRemoteApplicationSettings sets the settings for the remote application.
type RelationHook ¶
type RelationHook struct { HookRelation jujuc.ContextRelation RemoteUnitName string RemoteApplicationName string }
RelationHook holds the values for the hook context.
type Relations ¶
type Relations struct {
Relations map[int]jujuc.ContextRelation
}
Relations holds the values for the hook context.
func (*Relations) SetNewRelation ¶
SetNewRelation adds the relation to the set of known relations.
func (*Relations) SetNewRelationWithLife ¶
func (*Relations) SetRelated ¶
SetRelated adds the provided unit information to the relation.
func (*Relations) SetRelation ¶
func (r *Relations) SetRelation(id int, relCtx jujuc.ContextRelation)
SetRelation adds the relation to the set of known relations.
type Settings ¶
Settings is a test double for jujuc.Settings.
type Status ¶
type Status struct { UnitStatus jujuc.StatusInfo ApplicationStatus jujuc.ApplicationStatusInfo }
Status holds the values for the hook context.
func (*Status) SetApplicationStatus ¶
func (s *Status) SetApplicationStatus(application jujuc.StatusInfo, units []jujuc.StatusInfo)
SetApplicationStatus builds a application status and sets it on the Status.
type Storage ¶
type Storage struct { Storage map[names.StorageTag]jujuc.ContextStorageAttachment StorageTag names.StorageTag Added map[string]params.StorageDirectives }
Storage holds the values for the hook context.
func (*Storage) AddUnitStorage ¶
func (s *Storage) AddUnitStorage(all map[string]params.StorageDirectives)
AddUnitStorage sets storage that should be added.
func (*Storage) SetAttachment ¶
func (s *Storage) SetAttachment(attach jujuc.ContextStorageAttachment)
SetAttachment adds the attachment to the storage.
func (*Storage) SetBlockStorage ¶
SetBlockStorage adds the attachment to the storage.
func (*Storage) SetNewAttachment ¶
func (s *Storage) SetNewAttachment(name, location string, kind storage.StorageKind, stub *testing.Stub)
SetNewAttachment adds the attachment to the storage.
func (*Storage) SetStorageTag ¶
SetStorageTag sets the storage tag to the given ID.
func (*Storage) SetUnitStorage ¶
func (s *Storage) SetUnitStorage(name string, constraints params.StorageDirectives)
SetUnitStorage sets storage that should be added.
type StorageAttachment ¶
type StorageAttachment struct { Tag names.StorageTag Kind storage.StorageKind Location string }
StorageAttachment holds the data for the test double.
type Unit ¶
type Unit struct { Name string ConfigSettings charm.Settings GoalState application.GoalState K8sSpec string RawK8sSpec string CloudSpec params.CloudSpec }
Unit holds the values for the hook context.
type UnitCharmState ¶
type UnitCharmState struct {
// contains filtered or unexported fields
}
func (*UnitCharmState) SetCharmState ¶
func (u *UnitCharmState) SetCharmState(newCharmState map[string]string)
type Version ¶
type Version struct {
WorkloadVersion string
}
Version holds values for the hook context.
type WorkloadHook ¶
type WorkloadHook struct {
WorkloadName string
}
WorkloadHook holds the values for the hook context.