Documentation ¶
Index ¶
- type CreateInstanceRequest
- type Instance
- func (i *Instance) AddService(consulClient *consul.Client, service, config string) (*Instance, error)
- func (i *Instance) ConfigureService(consulClient *consul.Client, serviceType, config string) (*Service, error)
- func (i *Instance) DestroyInstance(consulClient *consul.Client, vaultClient *vault.Client) error
- func (i *Instance) GenerateConsulToken(consulClient *consul.Client) (string, error)
- func (i *Instance) GetInstance(consulClient *consul.Client) (*Instance, error)
- func (i *Instance) GetService(consulClient *consul.Client, serviceType string) (*Service, error)
- func (i *Instance) RemoveService(consulClient *consul.Client, service string) (*Instance, error)
- func (i *Instance) SetInstanceFields(consulClient *consul.Client, instanceFields map[string]string) (*Instance, error)
- func (i *Instance) ToMessage() (*pb.Instance, error)
- type Service
- type Services
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateInstanceRequest ¶
CreateInstanceRequest describes the params for creating an instance
type Instance ¶
type Instance struct { ID string Provider *provider.Provider Services Services Owner string Device string }
Instance is a open-copilot managed instance
func CreateInstance ¶
func CreateInstance(consulClient *consul.Client, vaultClient *vault.Client, instanceParams CreateInstanceRequest) (*Instance, error)
CreateInstance creates the key/value pairs for a new instance in Consul
func NewInstance ¶
NewInstance returns a new instance
func (*Instance) AddService ¶
func (i *Instance) AddService(consulClient *consul.Client, service, config string) (*Instance, error)
AddService adds a service in consul
func (*Instance) ConfigureService ¶
func (i *Instance) ConfigureService(consulClient *consul.Client, serviceType, config string) (*Service, error)
ConfigureService sets the configuration for a service in Consul
func (*Instance) DestroyInstance ¶
DestroyInstance removes an instance from Consul
func (*Instance) GenerateConsulToken ¶
GenerateConsulToken generates an ACL in consul for this instance
func (*Instance) GetInstance ¶
GetInstance gets instance info
func (*Instance) GetService ¶
GetService returns the service requested
func (*Instance) RemoveService ¶
RemoveService removes a service from Consul
Click to show internal directories.
Click to hide internal directories.