Documentation
¶
Index ¶
- type Client
- func (C *Client) Container(ID string) (*Container, error)
- func (C *Client) ContainerByName(name string) (*Container, error)
- func (C *Client) ContainerDns(ID string) (*ContainerDns, error)
- func (C *Client) ContainerEnv(ID string) (*ContainerEnv, error)
- func (C *Client) ContainerVolume(ID string) (*ContainerVolume, error)
- func (C *Client) Containers() (*[]Container, error)
- func (C *Client) ContainersAdd(c *Container) (*Container, error)
- func (C *Client) ContainersCIDUpdate(containerID, cID string) error
- func (C *Client) ContainersEnabledUpdate(containerID string, enabled bool) error
- func (C *Client) Machine(ID string) (*Machine, error)
- func (C *Client) MachineByName(name string) (*Machine, error)
- func (C *Client) Machines() (*[]Machine, error)
- func (C *Client) MachinesAdd(c *Machine) (*Machine, error)
- func (C *Client) MachinesEsClientIdUpdate(machineID, es_client_id string) error
- type Config
- type Container
- func (c *Container) AddToManyIDs(name string, IDs []string) error
- func (c *Container) DeleteToManyIDs(name string, IDs []string) error
- func (c Container) GetID() string
- func (c Container) GetReferencedIDs() []jsonapi.ReferenceID
- func (c Container) GetReferencedStructs() []jsonapi.MarshalIdentifier
- func (c Container) GetReferences() []jsonapi.Reference
- func (c *Container) SetID(id string) error
- func (c *Container) SetToManyReferenceIDs(name string, IDs []string) error
- func (c *Container) SetToOneReferenceID(name, ID string) error
- type ContainerDns
- type ContainerEnv
- type ContainerExpose
- type ContainerLink
- type ContainerNic
- type ContainerPublish
- type ContainerVolume
- type Machine
- func (m *Machine) AddToManyIDs(name string, IDs []string) error
- func (m *Machine) DeleteToManyIDs(name string, IDs []string) error
- func (m Machine) GetID() string
- func (m Machine) GetReferencedIDs() []jsonapi.ReferenceID
- func (m Machine) GetReferencedStructs() []jsonapi.MarshalIdentifier
- func (m Machine) GetReferences() []jsonapi.Reference
- func (m *Machine) SetID(id string) error
- func (m *Machine) SetToManyReferenceIDs(name string, IDs []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// The client configuration
Config Config
// contains filtered or unexported fields
}
Client the main Harmony Client
func NewHarmonyClient ¶
NewHarmonyClient returns a new Harmony Client instance
func (*Client) ContainerByName ¶
ContainerByName will fetch a container by its name
func (*Client) ContainerDns ¶
func (C *Client) ContainerDns(ID string) (*ContainerDns, error)
ContainerDns gets an DNS resource by ID
func (*Client) ContainerEnv ¶
func (C *Client) ContainerEnv(ID string) (*ContainerEnv, error)
ContainerEnv gets an env resource by ID
func (*Client) ContainerVolume ¶
func (C *Client) ContainerVolume(ID string) (*ContainerVolume, error)
ContainerVolume gets a volume resource by ID
func (*Client) Containers ¶
Containers gets a list of all the containers
func (*Client) ContainersAdd ¶
ContainersAdd will create a new Container resource
func (*Client) ContainersCIDUpdate ¶
FIXME: ref to json-api/json-api#588 ContainersCIDUpdate will update a container with the propper cID
func (*Client) ContainersEnabledUpdate ¶
FIXME: ref to json-api/json-api#588 ContainersEnabledUpdate will update a container's enabled state
func (*Client) MachineByName ¶
MachineByName will fetch a machine by its name
func (*Client) MachinesAdd ¶
MachinesAdd will create a Harmony Machine resource
func (*Client) MachinesEsClientIdUpdate ¶
MachinesEsClientIdUpdate will update a machine's es_client_id
type Container ¶
type Container struct {
ID string `jsonapi:"name=id"`
MachineID string `jsonapi:"name=machine_id"`
CID string `jsonapi:"name=cid"`
Name string `jsonapi:"name=name"`
Hostname string `jsonapi:"name=hostname"`
Restart string `jsonapi:"name=restart"`
Image string `jsonapi:"name=image"`
EntryPoint string `jsonapi:"name=entry_point"`
Cmd string `jsonapi:"name=cmd"`
Tty bool `jsonapi:"name=enabled"`
Interactive bool `jsonapi:"name=interactive"`
Enabled bool `jsonapi:"name=enabled"`
CreatedAt string `jsonapi:"name=created_at"`
UpdatedAt string `jsonapi:"name=updated_at"`
ContainerDns []ContainerDns `json:"-"`
ContainerDnsIDs []string `json:"-"`
ContainerEnvs []ContainerEnv `json:"-"`
ContainerEnvsIDs []string `json:"-"`
ContainerExposes []ContainerExpose `json:"-"`
ContainerExposesIDs []string `json:"-"`
ContainerLinks []ContainerLink `json:"-"`
ContainerLinksIDs []string `json:"-"`
ContainerNics []ContainerNic `json:"-"`
ContainerNicsIDs []string `json:"-"`
ContainerPublishes []ContainerPublish `json:"-"`
ContainerPublishesIDs []string `json:"-"`
ContainerVolumes []ContainerVolume `json:"-"`
ContainerVolumesIDs []string `json:"-"`
Machine Machine `json:"-"`
}
Container is a generic database user
func (*Container) AddToManyIDs ¶
AddToManyIDs adds some new sweets that a users loves so much
func (*Container) DeleteToManyIDs ¶
DeleteToManyIDs removes some sweets from a users because they made him very sick
func (Container) GetReferencedIDs ¶
func (c Container) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Container) GetReferencedStructs ¶
func (c Container) GetReferencedStructs() []jsonapi.MarshalIdentifier
GetReferencedStructs to satisfy the jsonapi.MarhsalIncludedRelations interface
func (Container) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
func (*Container) SetToManyReferenceIDs ¶
SetToManyReferenceIDs sets the sweets reference IDs and satisfies the jsonapi.UnmarshalToManyRelations interface
func (*Container) SetToOneReferenceID ¶
SetToOneReferenceID sets the reference ID and satifices jsonapi.UnmarshalToOneRelations interface
type ContainerDns ¶
type ContainerDns struct {
ID string `jsonapi:"name=id"`
ContainerID string `jsonapi:"name=container_id"`
Nameserver string `jsonapi:"name=nameserver"`
}
ContainerDns holds a container's dns resource
func (ContainerDns) GetID ¶
func (c ContainerDns) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (*ContainerDns) SetID ¶
func (c *ContainerDns) SetID(id string) error
SetID to satisfy jsonapi.UnmarshalIdentifier interface
func (*ContainerDns) SetToOneReferenceID ¶
func (c *ContainerDns) SetToOneReferenceID(name, ID string) error
SetToOneReferenceID sets the reference ID and satifices jsonapi.UnmarshalToOneRelations interface
type ContainerEnv ¶
type ContainerEnv struct {
ID string `jsonapi:"name=id"`
ContainerID string `jsonapi:"name=container_id"`
Name string `jsonapi:"name=name"`
Value string `jsonapi:"name=value"`
}
ContainerEnv holds a container's environment variable
func (ContainerEnv) GetID ¶
func (c ContainerEnv) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (*ContainerEnv) SetID ¶
func (c *ContainerEnv) SetID(id string) error
SetID to satisfy jsonapi.UnmarshalIdentifier interface
func (*ContainerEnv) SetToOneReferenceID ¶
func (c *ContainerEnv) SetToOneReferenceID(name, ID string) error
SetToOneReferenceID sets the reference ID and satifices jsonapi.UnmarshalToOneRelations interface
type ContainerExpose ¶
type ContainerExpose struct {
ID string `jsonapi:"name=id"`
ContainerID string `jsonapi:"name=container_id"`
RangeStart string `jsonapi:"name=range_start"`
RangeEnd string `jsonapi:"name=range_end"`
}
ContainerExpose holds a container's expose resource
func (ContainerExpose) GetID ¶
func (c ContainerExpose) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (*ContainerExpose) SetID ¶
func (c *ContainerExpose) SetID(id string) error
SetID to satisfy jsonapi.UnmarshalIdentifier interface
func (*ContainerExpose) SetToOneReferenceID ¶
func (c *ContainerExpose) SetToOneReferenceID(name, ID string) error
SetToOneReferenceID sets the reference ID and satifices jsonapi.UnmarshalToOneRelations interface
type ContainerLink ¶
type ContainerLink struct {
ID string `jsonapi:"name=id"`
ContainerID string `jsonapi:"name=container_id"`
ContainerFromID string `jsonapi:"name=container_from_id"`
}
ContainerLink holds a container's link resource
func (ContainerLink) GetID ¶
func (c ContainerLink) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (*ContainerLink) SetID ¶
func (c *ContainerLink) SetID(id string) error
SetID to satisfy jsonapi.UnmarshalIdentifier interface
func (*ContainerLink) SetToOneReferenceID ¶
func (c *ContainerLink) SetToOneReferenceID(name, ID string) error
SetToOneReferenceID sets the reference ID and satifices jsonapi.UnmarshalToOneRelations interface
type ContainerNic ¶
type ContainerNic struct {
ID string `jsonapi:"name=id"`
ContainerID string `jsonapi:"name=container_id"`
BridgeDev string `jsonapi:"name=bridge_dev"`
ContainerDev string `jsonapi:"name=container_dev"`
IP string `jsonapi:"name=ip"`
Netmask string `jsonapi:"name=netmask"`
Gateway string `jsonapi:"name=gateway"`
}
ContainerNic holds a container's nic
func (ContainerNic) GetID ¶
func (c ContainerNic) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (*ContainerNic) SetID ¶
func (c *ContainerNic) SetID(id string) error
SetID to satisfy jsonapi.UnmarshalIdentifier interface
func (*ContainerNic) SetToOneReferenceID ¶
func (c *ContainerNic) SetToOneReferenceID(name, ID string) error
SetToOneReferenceID sets the reference ID and satifices jsonapi.UnmarshalToOneRelations interface
type ContainerPublish ¶
type ContainerPublish struct {
ID string `jsonapi:"name=id"`
ContainerID string `jsonapi:"name=container_id"`
ContainerPort string `jsonapi:"name=container_port"`
HostPort string `jsonapi:"name=host_port"`
IP string `jsonapi:"name=ip"`
}
ContainerPublish holds a container's publish resource
func (ContainerPublish) GetID ¶
func (c ContainerPublish) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (*ContainerPublish) SetID ¶
func (c *ContainerPublish) SetID(id string) error
SetID to satisfy jsonapi.UnmarshalIdentifier interface
func (*ContainerPublish) SetToOneReferenceID ¶
func (c *ContainerPublish) SetToOneReferenceID(name, ID string) error
SetToOneReferenceID sets the reference ID and satifices jsonapi.UnmarshalToOneRelations interface
type ContainerVolume ¶
type ContainerVolume struct {
ID string `jsonapi:"name=id"`
ContainerID string `jsonapi:"name=container_id"`
PathHost string `jsonapi:"name=path_host"`
PathContainer string `jsonapi:"name=path_container"`
}
ContainerVolume holds a container's volume
func (ContainerVolume) GetID ¶
func (c ContainerVolume) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (*ContainerVolume) SetID ¶
func (c *ContainerVolume) SetID(id string) error
SetID to satisfy jsonapi.UnmarshalIdentifier interface
func (*ContainerVolume) SetToOneReferenceID ¶
func (c *ContainerVolume) SetToOneReferenceID(name, ID string) error
SetToOneReferenceID sets the reference ID and satifices jsonapi.UnmarshalToOneRelations interface
type Machine ¶
type Machine struct {
ID string `jsonapi:"name=id"`
Name string `jsonapi:"name=name"`
Hostname string `jsonapi:"name=hostname"`
IP string `jsonapi:"name=ip"`
Es_client_id string `jsonapi:"name=es_client_id"`
CreatedAt string `jsonapi:"name=created_at"`
UpdatedAt string `jsonapi:"name=updated_at"`
Containers []Container `json:"-"`
ContainerIDs []string `json:"-"`
}
Machine holds a Harmony Machine
func (*Machine) AddToManyIDs ¶
AddToManyIDs adds some new sweets that a users loves so much
func (*Machine) DeleteToManyIDs ¶
DeleteToManyIDs removes some sweets from a users because they made him very sick
func (Machine) GetReferencedIDs ¶
func (m Machine) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Machine) GetReferencedStructs ¶
func (m Machine) GetReferencedStructs() []jsonapi.MarshalIdentifier
GetReferencedStructs to satisfy the jsonapi.MarhsalIncludedRelations interface
func (Machine) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface