Documentation ¶
Index ¶
- Variables
- func Getenv(env, defaultVal string) string
- type Artifact
- type Check
- type Config
- type Constraint
- type DeploymentInfo
- type DispatchPayload
- type DynamicPort
- type EphemeralDisk
- type Job
- type LogConfig
- type Logging
- type Network
- type Nomad
- func (sc *Nomad) Deploy(jobID, releaseID string, memory, cpuShare int) (*DeploymentInfo, error)
- func (sc *Nomad) GetDeploymentStatus(jobID string) (string, error)
- func (sc *Nomad) GetName() string
- func (sc *Nomad) GetServiceDiscoverer() (ServiceDiscovery, error)
- func (sc *Nomad) SetAddr(addr string, https bool)
- func (sc *Nomad) Stop(jobID string) error
- type NomadJob
- type NomadService
- type NomadServiceDiscovery
- type Resources
- type RestartPolicy
- type Scheduler
- type Service
- type ServiceDiscovery
- type Task
- type TaskGroup
- type Template
- type Update
Constants ¶
This section is empty.
Variables ¶
var SupportedCocoonCodeLang = []string{"go"}
SupportedCocoonCodeLang defines the supported chaincode language
Functions ¶
Types ¶
type Check ¶
type Check struct { ID string `json:"Id"` Name string Type string Path string Port string Timeout int64 Interval int64 Protocol string }
Check defines a service check
type Config ¶
type Config struct { NetworkMode string `json:"network_mode"` Privileged bool `json:"privileged"` ForcePull bool `json:"force_pull"` Volumes []string `json:"volumes"` Image string `json:"image"` Command string `json:"command"` Args []string `json:"args"` Logging []Logging `json:"logging"` }
Config defines a driver/task configuration
type Constraint ¶
Constraint defines a job/task contraint
type DeploymentInfo ¶
type DeploymentInfo struct {
ID string
}
DeploymentInfo represents a successful deployment
type DispatchPayload ¶
type DispatchPayload struct {
File string
}
DispatchPayload configures tast to have access to dispatch payload
type DynamicPort ¶
type DynamicPort struct {
Label string
}
DynamicPort defines a dynamic port allocation
type EphemeralDisk ¶
EphemeralDisk is an ephemeral disk object
type Job ¶
type Job struct { Region string ID string Name string Type string Priority int AllAtOnce bool Datacenters []string Constraints []Constraint TaskGroups []TaskGroup Update Update }
Job defines a nomad job specification
type Network ¶
type Network struct { MBits int DynamicPorts []DynamicPort }
Network defines network allocation
type Nomad ¶
type Nomad struct { API string // contains filtered or unexported fields }
Nomad defines a nomad scheduler that implements scheduler.Scheduler interface. Every interaction with the scheduler is handled here.
func (*Nomad) Deploy ¶
func (sc *Nomad) Deploy(jobID, releaseID string, memory, cpuShare int) (*DeploymentInfo, error)
Deploy a cocoon code to the scheduler
func (*Nomad) GetDeploymentStatus ¶
GetDeploymentStatus gets the status of a job
func (*Nomad) GetServiceDiscoverer ¶
func (sc *Nomad) GetServiceDiscoverer() (ServiceDiscovery, error)
GetServiceDiscoverer returns an instance of the nomad service discovery
type NomadJob ¶
type NomadJob struct {
Job *Job
}
NomadJob represents a nomad job
func (*NomadJob) AssignSharedVolume ¶
AssignSharedVolume adds a shared volume on all tasks. The shared directory is added to the environment of all tasks. Shared volumes will be located in the tmp directory of the host
func (*NomadJob) SetVersion ¶
SetVersion set the connectors version
type NomadService ¶
NomadService defines a service
type NomadServiceDiscovery ¶
type NomadServiceDiscovery struct {
// contains filtered or unexported fields
}
NomadServiceDiscovery provides service discovery to the nomad schedulerAddr by querying a consul server
func NewNomadServiceDiscovery ¶
func NewNomadServiceDiscovery(client *api.Client) *NomadServiceDiscovery
NewNomadServiceDiscovery creates a nomad service discovery instance
type RestartPolicy ¶
RestartPolicy defines restart policy
type Scheduler ¶
type Scheduler interface { GetName() string Deploy(jobID, releaseID string, memory, cpuShare int) (*DeploymentInfo, error) SetAddr(addr string, https bool) GetServiceDiscoverer() (ServiceDiscovery, error) GetDeploymentStatus(jobID string) (string, error) Stop(jobID string) error }
Scheduler defines an interface for cluster interactions
type ServiceDiscovery ¶
type ServiceDiscovery interface {
GetByID(name string, query map[string]string) ([]*Service, error)
}
ServiceDiscovery defines an interface for finding services within a cluster
type Task ¶
type Task struct { Name string Driver string Config Config Env map[string]string Services []NomadService Meta map[string]string LogConfig LogConfig KillTimeout int64 Templates []Template Artifacts []Artifact Resources Resources DispatchPayload DispatchPayload }
Task defines a job task
type TaskGroup ¶
type TaskGroup struct { Name string Count int Constraints []string Tasks []*Task EphemeralDisk EphemeralDisk RestartPolicy RestartPolicy Meta map[string]string }
TaskGroup defines the task_group stanza