Documentation ¶
Overview ¶
Package service is a generated protocol buffer package.
It is generated from these files:
github.com/mesg-foundation/core/service/service.proto
It has these top-level messages:
Service Task Fee Event Output Parameter Dependency
Index ¶
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func List() (res []string, err error)
- func MustAsset(name string) []byte
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func ValidService(path string) (warnings []gojsonschema.ResultError, err error)
- type Dependency
- func (*Dependency) Descriptor() ([]byte, []int)
- func (m *Dependency) GetCommand() string
- func (m *Dependency) GetImage() string
- func (m *Dependency) GetPorts() []string
- func (m *Dependency) GetVolumes() []string
- func (m *Dependency) GetVolumesfrom() []string
- func (dependency *Dependency) IsRunning(namespace string, name string) (running bool)
- func (dependency *Dependency) IsStopped(namespace string, name string) (running bool)
- func (*Dependency) ProtoMessage()
- func (m *Dependency) Reset()
- func (dependency *Dependency) Start(service *Service, details dependencyDetails, networkID string) (serviceID string, err error)
- func (dependency *Dependency) Stop(name string, dependencyName string) (err error)
- func (m *Dependency) String() string
- type Event
- type Fee
- type Output
- type Parameter
- func (*Parameter) Descriptor() ([]byte, []int)
- func (m *Parameter) GetDescription() string
- func (m *Parameter) GetName() string
- func (m *Parameter) GetOptional() bool
- func (m *Parameter) GetType() string
- func (*Parameter) ProtoMessage()
- func (m *Parameter) Reset()
- func (m *Parameter) String() string
- type Publish
- type Service
- func (*Service) Descriptor() ([]byte, []int)
- func (service *Service) EventSubscriptionChannel() string
- func (m *Service) GetConfiguration() *Dependency
- func (m *Service) GetDependencies() map[string]*Dependency
- func (m *Service) GetDescription() string
- func (m *Service) GetEvents() map[string]*Event
- func (m *Service) GetName() string
- func (m *Service) GetPublish() string
- func (m *Service) GetTasks() map[string]*Task
- func (m *Service) GetVisibility() string
- func (service *Service) Hash() (hash string)
- func (service *Service) IsPartiallyRunning() (running bool)
- func (service *Service) IsRunning() (running bool)
- func (service *Service) IsStopped() (running bool)
- func (*Service) ProtoMessage()
- func (m *Service) Reset()
- func (service *Service) ResultSubscriptionChannel() string
- func (service *Service) Start() (serviceIDs []string, err error)
- func (service *Service) Stop() (err error)
- func (service *Service) StopDependencies() (err error)
- func (m *Service) String() string
- func (service *Service) TaskSubscriptionChannel() string
- type StatusType
- type Task
- func (*Task) Descriptor() ([]byte, []int)
- func (m *Task) GetDescription() string
- func (m *Task) GetFees() *Fee
- func (m *Task) GetInputs() map[string]*Parameter
- func (m *Task) GetName() string
- func (m *Task) GetOutputs() map[string]*Output
- func (m *Task) GetPayable() bool
- func (m *Task) GetVerifiable() bool
- func (*Task) ProtoMessage()
- func (m *Task) Reset()
- func (m *Task) String() string
- type Visibility
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset ¶
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
func AssetDir ¶
AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:
data/ foo.txt img/ a.png b.png
then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.
func AssetInfo ¶
AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.
func MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func ValidService ¶
func ValidService(path string) (warnings []gojsonschema.ResultError, err error)
ValidService validates a service at a given path
Types ¶
type Dependency ¶
type Dependency struct { Image string `protobuf:"bytes,1,opt,name=image" json:"image,omitempty"` Volumes []string `protobuf:"bytes,2,rep,name=volumes" json:"volumes,omitempty"` Volumesfrom []string `protobuf:"bytes,3,rep,name=volumesfrom" json:"volumesfrom,omitempty"` Ports []string `protobuf:"bytes,4,rep,name=ports" json:"ports,omitempty"` Command string `protobuf:"bytes,5,opt,name=command" json:"command,omitempty"` }
func (*Dependency) Descriptor ¶
func (*Dependency) Descriptor() ([]byte, []int)
func (*Dependency) GetCommand ¶
func (m *Dependency) GetCommand() string
func (*Dependency) GetImage ¶
func (m *Dependency) GetImage() string
func (*Dependency) GetPorts ¶
func (m *Dependency) GetPorts() []string
func (*Dependency) GetVolumes ¶
func (m *Dependency) GetVolumes() []string
func (*Dependency) GetVolumesfrom ¶
func (m *Dependency) GetVolumesfrom() []string
func (*Dependency) IsRunning ¶
func (dependency *Dependency) IsRunning(namespace string, name string) (running bool)
IsRunning returns true if the dependency is running, false otherwise
func (*Dependency) IsStopped ¶
func (dependency *Dependency) IsStopped(namespace string, name string) (running bool)
IsStopped returns true if the dependency is stopped, false otherwise
func (*Dependency) ProtoMessage ¶
func (*Dependency) ProtoMessage()
func (*Dependency) Reset ¶
func (m *Dependency) Reset()
func (*Dependency) Start ¶ added in v0.3.0
func (dependency *Dependency) Start(service *Service, details dependencyDetails, networkID string) (serviceID string, err error)
Start will start a dependency container
func (*Dependency) Stop ¶ added in v0.3.0
func (dependency *Dependency) Stop(name string, dependencyName string) (err error)
Stop a dependency
func (*Dependency) String ¶
func (m *Dependency) String() string
type Event ¶
type Event struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` Data map[string]*Parameter `` /* 128-byte string literal not displayed */ }
func (*Event) Descriptor ¶
func (*Event) GetDescription ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
type Fee ¶
type Fee struct { Developer string `protobuf:"bytes,1,opt,name=developer" json:"developer,omitempty"` Validator string `protobuf:"bytes,2,opt,name=validator" json:"validator,omitempty"` Executor string `protobuf:"bytes,3,opt,name=executor" json:"executor,omitempty"` Emittors string `protobuf:"bytes,4,opt,name=emittors" json:"emittors,omitempty"` }
func (*Fee) Descriptor ¶
func (*Fee) GetDeveloper ¶
func (*Fee) GetEmittors ¶
func (*Fee) GetExecutor ¶
func (*Fee) GetValidator ¶
func (*Fee) ProtoMessage ¶
func (*Fee) ProtoMessage()
type Output ¶
type Output struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` Data map[string]*Parameter `` /* 128-byte string literal not displayed */ }
func (*Output) Descriptor ¶
func (*Output) GetDescription ¶
func (*Output) ProtoMessage ¶
func (*Output) ProtoMessage()
type Parameter ¶
type Parameter struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` Type string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` Optional bool `protobuf:"varint,4,opt,name=optional" json:"optional,omitempty"` }
func (*Parameter) Descriptor ¶
func (*Parameter) GetDescription ¶
func (*Parameter) GetOptional ¶
func (*Parameter) ProtoMessage ¶
func (*Parameter) ProtoMessage()
type Publish ¶
type Publish string
Publish let you configure the part of your service you want to publish
type Service ¶
type Service struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` Visibility string `protobuf:"bytes,3,opt,name=visibility" json:"visibility,omitempty"` Publish string `protobuf:"bytes,4,opt,name=publish" json:"publish,omitempty"` Tasks map[string]*Task `` /* 130-byte string literal not displayed */ Events map[string]*Event `` /* 132-byte string literal not displayed */ Dependencies map[string]*Dependency `` /* 144-byte string literal not displayed */ Configuration *Dependency `protobuf:"bytes,8,opt,name=configuration" json:"configuration,omitempty"` }
func ImportFromPath ¶
ImportFromPath returns the service of the given path
func (*Service) Descriptor ¶
func (*Service) EventSubscriptionChannel ¶
EventSubscriptionChannel returns the channel to listen for events from this service
func (*Service) GetConfiguration ¶
func (m *Service) GetConfiguration() *Dependency
func (*Service) GetDependencies ¶
func (m *Service) GetDependencies() map[string]*Dependency
func (*Service) GetDescription ¶
func (*Service) GetPublish ¶
func (*Service) GetVisibility ¶
func (*Service) IsPartiallyRunning ¶
IsPartiallyRunning returns true if the service is running, false otherwise
func (*Service) ProtoMessage ¶
func (*Service) ProtoMessage()
func (*Service) ResultSubscriptionChannel ¶
ResultSubscriptionChannel returns the channel to listen for tasks from this service
func (*Service) StopDependencies ¶
StopDependencies stops all dependencies
func (*Service) TaskSubscriptionChannel ¶
TaskSubscriptionChannel returns the channel to listen for tasks from this service
type StatusType ¶
type StatusType uint
StatusType of the service
const ( STOPPED StatusType = 0 RUNNING StatusType = 1 PARTIAL StatusType = 2 )
status for services
type Task ¶
type Task struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description" json:"description,omitempty"` Verifiable bool `protobuf:"varint,3,opt,name=verifiable" json:"verifiable,omitempty"` Payable bool `protobuf:"varint,4,opt,name=payable" json:"payable,omitempty"` Fees *Fee `protobuf:"bytes,5,opt,name=fees" json:"fees,omitempty"` Inputs map[string]*Parameter `` /* 132-byte string literal not displayed */ Outputs map[string]*Output `` /* 134-byte string literal not displayed */ }
func (*Task) Descriptor ¶
func (*Task) GetDescription ¶
func (*Task) GetOutputs ¶
func (*Task) GetPayable ¶
func (*Task) GetVerifiable ¶
func (*Task) ProtoMessage ¶
func (*Task) ProtoMessage()
type Visibility ¶
type Visibility string
Visibility is the tags to set is the service is visible for whom
const ( VisibilityAll Visibility = "ALL" VisibilityUsers Visibility = "USERS" VisibilityWorkers Visibility = "WORKERS" VisibilityNone Visibility = "NONE" )
List of visibilities flags