Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) AddDomain(ctx context.Context, projectID, serviceID string, domain string) (err error)
- func (c *Client) Get(ctx context.Context, projectID, serviceID string) (s Service, err error)
- func (c *Client) GetEnvironmentVariables(ctx context.Context, projectID, serviceID string) (envs []EnvironmentVariable, err error)
- func (c *Client) Link(ctx context.Context, projectID string, service Service, source string) (err error)
- func (c *Client) List(ctx context.Context, projectID string) (Services, error)
- func (c *Client) RemoveDomain(ctx context.Context, projectID string, serviceID, domain string) (err error)
- func (c *Client) Restart(ctx context.Context, projectID, serviceID string) error
- func (c *Client) SetEnvironmentVariable(ctx context.Context, projectID, serviceID, key, value string) error
- func (c *Client) Unlink(ctx context.Context, projectID, serviceID string) error
- func (c *Client) UnsetEnvironmentVariable(ctx context.Context, projectID, serviceID, key string) error
- func (c *Client) Validate(ctx context.Context, projectID, serviceID string) (err error)
- type EnvironmentVariable
- type Register
- type Service
- type ServiceInfo
- type ServiceInfoList
- type ServicePackage
- type Services
Constants ¶
This section is empty.
Variables ¶
var ( // ErrServiceNotFound happens when a wedeploy.json is not found ErrServiceNotFound = errors.New("Service not found") // ErrServiceAlreadyExists happens when a service ID already exists ErrServiceAlreadyExists = errors.New("Service already exists") // ErrInvalidServiceID happens when a service ID is invalid ErrInvalidServiceID = errors.New("Invalid service ID") // ErrEmptyProjectID happens when trying to access a project, but providing an empty ID ErrEmptyProjectID = errors.New("Can not get project: Project ID is empty") // ErrEmptyServiceID happens when trying to access a service, but providing an empty ID ErrEmptyServiceID = errors.New("Can not get service: Service ID is empty") // ErrEmptyProjectAndServiceID happens when trying to access a service, but providing empty IDs ErrEmptyProjectAndServiceID = errors.New("Can not get service: Project and Service ID is empty") )
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v1.1.5
Client for the services
func (*Client) AddDomain ¶ added in v1.1.5
func (c *Client) AddDomain(ctx context.Context, projectID, serviceID string, domain string) (err error)
AddDomain in project
func (*Client) GetEnvironmentVariables ¶ added in v1.1.5
func (c *Client) GetEnvironmentVariables(ctx context.Context, projectID, serviceID string) (envs []EnvironmentVariable, err error)
GetEnvironmentVariables of a service
func (*Client) Link ¶ added in v1.1.5
func (c *Client) Link(ctx context.Context, projectID string, service Service, source string) (err error)
Link service to project
func (*Client) RemoveDomain ¶ added in v1.1.5
func (c *Client) RemoveDomain(ctx context.Context, projectID string, serviceID, domain string) (err error)
RemoveDomain in project
func (*Client) SetEnvironmentVariable ¶ added in v1.1.5
func (c *Client) SetEnvironmentVariable(ctx context.Context, projectID, serviceID, key, value string) error
SetEnvironmentVariable sets an environment variable
type EnvironmentVariable ¶
type EnvironmentVariable struct {
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
}
EnvironmentVariable of a service
type Register ¶
type Register struct {
ID string `json:"id"`
Image string `json:"image"`
Category string `json:"category"`
Description string `json:"description"`
}
Register for the service structure
type Service ¶
type Service struct {
ServiceID string `json:"serviceId,omitempty"`
Health string `json:"health,omitempty"`
Image string `json:"image,omitempty"`
ImageHint string `json:"imageHint,omitempty"`
CustomDomains []string `json:"customDomains,omitempty"`
Env map[string]string `json:"env,omitempty"`
Scale int `json:"scale,omitempty"`
CPU json.Number `json:"cpu,omitempty"`
Memory json.Number `json:"memory,omitempty"`
HealthUID string `json:"healthUid,omitempty"`
}
Service structure
type ServiceInfo ¶
ServiceInfo is for a tuple of service ID and Location.
type ServiceInfoList ¶
type ServiceInfoList []ServiceInfo
ServiceInfoList is a list of ServiceInfo
func GetListFromDirectory ¶
func GetListFromDirectory(root string) (ServiceInfoList, error)
GetListFromDirectory returns a list of services on the given diretory
func (ServiceInfoList) Get ¶
func (c ServiceInfoList) Get(ID string) (ServiceInfo, error)
Get service info from service info list
func (ServiceInfoList) GetIDs ¶
func (c ServiceInfoList) GetIDs() []string
GetIDs returns the services ids of a given ServiceInfoList.
func (ServiceInfoList) GetLocations ¶
func (c ServiceInfoList) GetLocations() []string
GetLocations returns the locations of a given ServiceInfoList.
type ServicePackage ¶
type ServicePackage struct {
ID string `json:"id,omitempty"`
Scale int `json:"scale,omitempty"`
Image string `json:"image,omitempty"`
CustomDomains []string `json:"customDomains,omitempty"`
Env map[string]string `json:"env,omitempty"`
// contains filtered or unexported fields
}
ServicePackage is the structure for wedeploy.json
func Read ¶
func Read(path string) (*ServicePackage, error)
Read a service directory properties (defined by a wedeploy.json and/or Dockerfile on it)
func (ServicePackage) Service ¶
func (cp ServicePackage) Service() *Service
Service returns a Service type created taking wedeploy.json as base