Documentation ¶
Overview ¶
Package mock is a mock Backend for Flitter. It should be used as an example of what a fully featured Backend implementation should look like. It is also used in testing.
Index ¶
- type Actor
- type ActorInfo
- type Backend
- func (b *Backend) Deploy(a *Actor) error
- func (b *Backend) Destroy(a *Actor) error
- func (b *Backend) GetActorer(pattern string) (*Actor, error)
- func (b *Backend) Info() (i *BackendInfo)
- func (b *Backend) ListDeploys(pattern string) (res []*Actor, err error)
- func (b *Backend) Restart(a *Actor) error
- func (b *Backend) Start(a *Actor) error
- func (b *Backend) Stop(a *Actor) error
- type BackendInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct {
// contains filtered or unexported fields
}
Struct Actor represents a single worker running a given image with given tags.
func (*Actor) Restart ¶
Restart calls Stop and then Start and returns an error if either fails, bailing out on the first failure.
func (*Actor) Status ¶
func (a *Actor) Status() deployment.Status
Status returns the Actor's status as a deployment.Status.
type ActorInfo ¶
type ActorInfo struct { Name string `json:"name"` Tags []string `json:"tags"` Image string `json:"image"` Status deployment.Status `json:"status"` }
Struct ActorInfo is the serializable form of Actor.
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Struct Backend is a mock backend for scheduling and starting Actors.
func (*Backend) Deploy ¶
Deploy introduces a new Actor to the Backend if the Actor is unique to the Backend.
func (*Backend) Destroy ¶
Destroy destroys the Actor from the list of active Actors and returns an error if the given actor doesn't exist.
func (*Backend) GetActorer ¶
GetActorer looks for an Actor by name pattern and returns it or an error describing the failure.
func (*Backend) Info ¶
func (b *Backend) Info() (i *BackendInfo)
Info returns the serializable information about a mock Backend.
func (*Backend) ListDeploys ¶
ListDeploys returns a list of the Actors in the Backend.
type BackendInfo ¶
Struct BackendInfo is the serializable version of a Backend.