Documentation ¶
Index ¶
- type ActionHook
- type Context
- type ContextActionHook
- type ContextInfo
- type ContextInstance
- type ContextLeader
- type ContextMetrics
- type ContextNetworking
- func (c *ContextNetworking) ClosePorts(protocol string, from, to int) error
- func (c *ContextNetworking) OpenPorts(protocol string, from, to int) error
- func (c *ContextNetworking) OpenedPorts() []network.PortRange
- func (c *ContextNetworking) PrivateAddress() (string, bool)
- func (c *ContextNetworking) PublicAddress() (string, bool)
- type ContextRelation
- func (r *ContextRelation) FakeId() string
- func (r *ContextRelation) Id() int
- func (r *ContextRelation) Name() string
- func (r *ContextRelation) ReadSettings(name string) (params.Settings, error)
- func (r *ContextRelation) Settings() (jujuc.Settings, error)
- func (r *ContextRelation) UnitNames() []string
- type ContextRelationHook
- type ContextRelations
- type ContextStatus
- type ContextStorage
- type ContextStorageAttachment
- type ContextSuite
- type ContextUnit
- type Instance
- type Leadership
- type Metrics
- type NetworkInterface
- type Relation
- type RelationHook
- type Relations
- type Settings
- type Status
- type Storage
- func (s *Storage) AddUnitStorage(all map[string]params.StorageConstraints)
- 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.StorageConstraints)
- type StorageAttachment
- type Unit
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 ContextStatus ContextInstance ContextNetworking ContextLeader ContextMetrics ContextStorage ContextRelations ContextRelationHook ContextActionHook }
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) 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 string) error
UpdateActionResults implements jujuc.ActionHookContext.
type ContextInfo ¶
type ContextInfo struct { Unit Status Instance NetworkInterface Leadership Metrics Storage Relations RelationHook ActionHook }
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.
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, bool)
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 ¶
func (c *ContextLeader) LeaderSettings() (map[string]string, error)
LeaderSettings implements jujuc.ContextLeader.
func (*ContextLeader) WriteLeaderSettings ¶
func (c *ContextLeader) WriteLeaderSettings(settings map[string]string) error
WriteLeaderSettings implements jujuc.ContextLeader.
type ContextMetrics ¶
type ContextMetrics struct {
// contains filtered or unexported fields
}
ContextMetrics is a test double for jujuc.ContextMetrics.
type ContextNetworking ¶
type ContextNetworking struct {
// contains filtered or unexported fields
}
ContextNetworking is a test double for jujuc.ContextNetworking.
func (*ContextNetworking) ClosePorts ¶
func (c *ContextNetworking) ClosePorts(protocol string, from, to int) error
ClosePorts implements jujuc.ContextNetworking.
func (*ContextNetworking) OpenPorts ¶
func (c *ContextNetworking) OpenPorts(protocol string, from, to int) error
OpenPorts implements jujuc.ContextNetworking.
func (*ContextNetworking) OpenedPorts ¶
func (c *ContextNetworking) OpenedPorts() []network.PortRange
OpenedPorts implements jujuc.ContextNetworking.
func (*ContextNetworking) PrivateAddress ¶
func (c *ContextNetworking) PrivateAddress() (string, bool)
PrivateAddress implements jujuc.ContextNetworking.
func (*ContextNetworking) PublicAddress ¶
func (c *ContextNetworking) PublicAddress() (string, bool)
PublicAddress implements jujuc.ContextNetworking.
type ContextRelation ¶
type ContextRelation struct {
// contains filtered or unexported fields
}
ContextRelation is a test double for 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) Name ¶
func (r *ContextRelation) Name() string
Name implements jujuc.ContextRelation.
func (*ContextRelation) ReadSettings ¶
func (r *ContextRelation) ReadSettings(name string) (params.Settings, error)
ReadSettings implements jujuc.ContextRelation.
func (*ContextRelation) Settings ¶
func (r *ContextRelation) Settings() (jujuc.Settings, error)
Settings 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, bool)
HookRelation implements jujuc.RelationHookContext.
func (*ContextRelationHook) RemoteUnitName ¶
func (c *ContextRelationHook) RemoteUnitName() (string, bool)
RemoteUnitName implements jujuc.RelationHookContext.
type ContextRelations ¶
type ContextRelations struct {
// contains filtered or unexported fields
}
ContextRelations is a test double for jujuc.ContextRelations.
func (*ContextRelations) Relation ¶
func (c *ContextRelations) Relation(id int) (jujuc.ContextRelation, bool)
Relation implements jujuc.ContextRelations.
func (*ContextRelations) RelationIds ¶
func (c *ContextRelations) RelationIds() []int
RelationIds implements jujuc.ContextRelations.
type ContextStatus ¶
type ContextStatus struct {
// contains filtered or unexported fields
}
ContextStatus is a test double for jujuc.ContextStatus.
func (*ContextStatus) ServiceStatus ¶
func (c *ContextStatus) ServiceStatus() (jujuc.ServiceStatusInfo, error)
ServiceStatus implements jujuc.ContextStatus.
func (*ContextStatus) SetServiceStatus ¶
func (c *ContextStatus) SetServiceStatus(status jujuc.StatusInfo) error
SetServiceStatus implements jujuc.ContextStatus.
func (*ContextStatus) SetUnitStatus ¶
func (c *ContextStatus) SetUnitStatus(status jujuc.StatusInfo) error
SetUnitStatus implements jujuc.ContextStatus.
func (*ContextStatus) UnitStatus ¶
func (c *ContextStatus) UnitStatus() (*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.StorageConstraints)
AddUnitStorage implements jujuc.ContextStorage.
func (*ContextStorage) HookStorage ¶
func (c *ContextStorage) HookStorage() (jujuc.ContextStorageAttachment, bool)
HookStorage implements jujuc.ContextStorage.
func (*ContextStorage) Storage ¶
func (c *ContextStorage) Storage(tag names.StorageTag) (jujuc.ContextStorageAttachment, bool)
Storage 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 ¶
func (c *ContextUnit) ConfigSettings() (charm.Settings, error)
ConfigSettings implements jujuc.ContextUnit.
func (*ContextUnit) OwnerTag ¶
func (c *ContextUnit) OwnerTag() string
OwnerTag implements jujuc.ContextUnit.
func (*ContextUnit) UnitName ¶
func (c *ContextUnit) UnitName() string
UnitName implements jujuc.ContextUnit.
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 Ports []network.PortRange }
NetworkInterface holds the values for the hook context.
func (*NetworkInterface) AddPorts ¶
func (ni *NetworkInterface) AddPorts(protocol string, from, to int)
AddPorts adds the specified port range.
func (*NetworkInterface) CheckPorts ¶
func (ni *NetworkInterface) CheckPorts(c *gc.C, expected []network.PortRange)
CheckPorts checks the current ports.
func (*NetworkInterface) RemovePorts ¶
func (ni *NetworkInterface) RemovePorts(protocol string, from, to int)
RemovePorts 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 }
Relation holds the data for the test double.
func (*Relation) SetRelated ¶
SetRelated adds the relation settings for the unit.
type RelationHook ¶
type RelationHook struct { HookRelation jujuc.ContextRelation RemoteUnitName 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) 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 ServiceStatus jujuc.ServiceStatusInfo }
Status holds the values for the hook context.
func (*Status) SetServiceStatus ¶
func (s *Status) SetServiceStatus(service jujuc.StatusInfo, units []jujuc.StatusInfo)
SetServiceStatus builds a service 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.StorageConstraints }
Storage holds the values for the hook context.
func (*Storage) AddUnitStorage ¶
func (s *Storage) AddUnitStorage(all map[string]params.StorageConstraints)
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.StorageConstraints)
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.