Documentation ¶
Index ¶
- type CharmParams
- type EnvParams
- type EnvUserParams
- type Factory
- func (factory *Factory) MakeCharm(c *gc.C, params *CharmParams) *state.Charm
- func (factory *Factory) MakeEnvUser(c *gc.C, params *EnvUserParams) *state.EnvironmentUser
- func (factory *Factory) MakeEnvironment(c *gc.C, params *EnvParams) *state.State
- func (factory *Factory) MakeMachine(c *gc.C, params *MachineParams) *state.Machine
- func (factory *Factory) MakeMachineNested(c *gc.C, parentId string, params *MachineParams) *state.Machine
- func (factory *Factory) MakeMachineReturningPassword(c *gc.C, params *MachineParams) (*state.Machine, string)
- func (factory *Factory) MakeMetric(c *gc.C, params *MetricParams) *state.MetricBatch
- func (factory *Factory) MakeRelation(c *gc.C, params *RelationParams) *state.Relation
- func (factory *Factory) MakeService(c *gc.C, params *ServiceParams) *state.Service
- func (factory *Factory) MakeUnit(c *gc.C, params *UnitParams) *state.Unit
- func (factory *Factory) MakeUser(c *gc.C, params *UserParams) *state.User
- func (*Factory) RandomSuffix(prefix string) string
- type MachineParams
- type MetricParams
- type RelationParams
- type ServiceParams
- type UnitParams
- type UserParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CharmParams ¶
CharmParams defines the parameters for creating a charm.
type EnvUserParams ¶
EnvUserParams defines the parameters for creating an environment user.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func (*Factory) MakeCharm ¶
MakeCharm creates a charm with the values specified in params. Sensible default values are substituted for missing ones. Supported charms depend on the charm/testing package. Currently supported charms:
all-hooks, category, dummy, format2, logging, monitoring, mysql, mysql-alternative, riak, terracotta, upgrade1, upgrade2, varnish, varnish-alternative, wordpress.
If params is not specified, defaults are used.
func (*Factory) MakeEnvUser ¶
func (factory *Factory) MakeEnvUser(c *gc.C, params *EnvUserParams) *state.EnvironmentUser
MakeEnvUser will create a envUser with values defined by the params. For attributes of EnvUserParams that are the default empty values, some meaningful valid values are used instead. If params is not specified, defaults are used.
func (*Factory) MakeEnvironment ¶
MakeEnvironment creates an environment with specified params, filling in sane defaults for missing values. If params is nil, defaults are used for all values.
By default the new enviroment shares the same owner as the calling Factory's environment.
func (*Factory) MakeMachine ¶
MakeMachine will add a machine with values defined in params. For some values in params, if they are missing, some meaningful empty values will be set. If params is not specified, defaults are used.
func (*Factory) MakeMachineNested ¶
func (factory *Factory) MakeMachineNested(c *gc.C, parentId string, params *MachineParams) *state.Machine
MakeMachineNested will make a machine nested in the machine with ID given.
func (*Factory) MakeMachineReturningPassword ¶
func (factory *Factory) MakeMachineReturningPassword(c *gc.C, params *MachineParams) (*state.Machine, string)
MakeMachineReturningPassword will add a machine with values defined in params. For some values in params, if they are missing, some meaningful empty values will be set. If params is not specified, defaults are used. The machine and its password are returned.
func (*Factory) MakeMetric ¶
func (factory *Factory) MakeMetric(c *gc.C, params *MetricParams) *state.MetricBatch
MakeMetric makes a metric with specified params, filling in sane defaults for missing values. If params is not specified, defaults are used.
func (*Factory) MakeRelation ¶
MakeRelation create a relation with specified params, filling in sane defaults for missing values. If params is not specified, defaults are used.
func (*Factory) MakeService ¶
MakeService creates a service with the specified parameters, substituting sane defaults for missing values. If params is not specified, defaults are used.
func (*Factory) MakeUnit ¶
MakeUnit creates a service unit with specified params, filling in sane defaults for missing values. If params is not specified, defaults are used.
func (*Factory) MakeUser ¶
MakeUser will create a user with values defined by the params. For attributes of UserParams that are the default empty values, some meaningful valid values are used instead. If params is not specified, defaults are used.
func (*Factory) RandomSuffix ¶
RandomSuffix adds a random 5 character suffix to the presented string.
type MachineParams ¶
type MachineParams struct { Series string Jobs []state.MachineJob Password string Nonce string InstanceId instance.Id Characteristics *instance.HardwareCharacteristics Addresses []network.Address }
Params for creating a machine.
type MetricParams ¶
type RelationParams ¶
RelationParams are used to create relations.
type ServiceParams ¶
ServiceParams is used when specifying parameters for a new service.
type UnitParams ¶
UnitParams are used to create units.