service

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListRunning added in v1.0.0

func ListRunning() (res []string, err error)

ListRunning all the running services TODO: should move to another file

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) ProtoMessage

func (*Dependency) ProtoMessage()

func (*Dependency) Reset

func (m *Dependency) Reset()

func (*Dependency) String

func (m *Dependency) String() string

type DependencyFromService added in v1.0.0

type DependencyFromService struct {
	*Dependency
	Service *Service
	Name    string
}

DependencyFromService represents a Dependency, with a pointer to its service and its name

func (*DependencyFromService) Start added in v1.0.0

func (dependency *DependencyFromService) Start(networkID string) (containerServiceID string, err error)

Start will start a dependency container

func (*DependencyFromService) Status added in v1.0.0

func (dependency *DependencyFromService) Status() (status container.StatusType, err error)

Status returns the StatusType of this dependency's container

func (*DependencyFromService) Stop added in v1.0.0

func (dependency *DependencyFromService) Stop() (err error)

Stop a dependency

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) Descriptor() ([]byte, []int)

func (*Event) GetData

func (m *Event) GetData() map[string]*Parameter

func (*Event) GetDescription

func (m *Event) GetDescription() string

func (*Event) GetName

func (m *Event) GetName() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

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) Descriptor() ([]byte, []int)

func (*Fee) GetDeveloper

func (m *Fee) GetDeveloper() string

func (*Fee) GetEmittors

func (m *Fee) GetEmittors() string

func (*Fee) GetExecutor

func (m *Fee) GetExecutor() string

func (*Fee) GetValidator

func (m *Fee) GetValidator() string

func (*Fee) ProtoMessage

func (*Fee) ProtoMessage()

func (*Fee) Reset

func (m *Fee) Reset()

func (*Fee) String

func (m *Fee) String() string

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) Descriptor() ([]byte, []int)

func (*Output) GetData

func (m *Output) GetData() map[string]*Parameter

func (*Output) GetDescription

func (m *Output) GetDescription() string

func (*Output) GetName

func (m *Output) GetName() string

func (*Output) ProtoMessage

func (*Output) ProtoMessage()

func (*Output) Reset

func (m *Output) Reset()

func (*Output) String

func (m *Output) String() string

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) Descriptor() ([]byte, []int)

func (*Parameter) GetDescription

func (m *Parameter) GetDescription() string

func (*Parameter) GetName

func (m *Parameter) GetName() string

func (*Parameter) GetOptional

func (m *Parameter) GetOptional() bool

func (*Parameter) GetType

func (m *Parameter) GetType() string

func (*Parameter) ProtoMessage

func (*Parameter) ProtoMessage()

func (*Parameter) Reset

func (m *Parameter) Reset()

func (*Parameter) String

func (m *Parameter) String() string

type Publish

type Publish string

Publish let you configure the part of your service you want to publish

const (
	PublishAll       Publish = "ALL"
	PublishSource    Publish = "SOURCE"
	PublishContainer Publish = "CONTAINER"
	PublishNone      Publish = "NONE"
)

List of all publishes flags

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"`
	Repository    string                 `protobuf:"bytes,9,opt,name=repository" json:"repository,omitempty"`
}

func ImportFromPath

func ImportFromPath(path string) (service *Service, err error)

ImportFromPath returns the service of the given path

func (*Service) DependenciesFromService added in v1.0.0

func (s *Service) DependenciesFromService() (d []*DependencyFromService)

DependenciesFromService returns the an array of DependencyFromService

func (*Service) Descriptor

func (*Service) Descriptor() ([]byte, []int)

func (*Service) EventSubscriptionChannel

func (service *Service) EventSubscriptionChannel() string

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 (m *Service) GetDescription() string

func (*Service) GetEvents

func (m *Service) GetEvents() map[string]*Event

func (*Service) GetName

func (m *Service) GetName() string

func (*Service) GetPublish

func (m *Service) GetPublish() string

func (*Service) GetRepository added in v1.0.0

func (m *Service) GetRepository() string

func (*Service) GetTasks

func (m *Service) GetTasks() map[string]*Task

func (*Service) GetVisibility

func (m *Service) GetVisibility() string

func (*Service) Hash

func (service *Service) Hash() (hash string)

Hash calculate and return the hash of the service

func (*Service) Logs added in v1.0.0

func (service *Service) Logs(onlyForDependency string) (readers []io.ReadCloser, err error)

Logs return the service's docker service logs. Optionally only show the logs of a given dependency

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) Reset

func (m *Service) Reset()

func (*Service) ResultSubscriptionChannel

func (service *Service) ResultSubscriptionChannel() string

ResultSubscriptionChannel returns the channel to listen for tasks from this service

func (*Service) Start

func (service *Service) Start() (serviceIDs []string, err error)

Start a service

func (*Service) Status added in v1.0.0

func (service *Service) Status() (status StatusType, err error)

Status returns the StatusType of all dependency of this service

func (*Service) Stop

func (service *Service) Stop() (err error)

Stop a service

func (*Service) StopDependencies

func (service *Service) StopDependencies() (err error)

StopDependencies stops all dependencies

func (*Service) String

func (m *Service) String() string

func (*Service) TaskSubscriptionChannel

func (service *Service) TaskSubscriptionChannel() string

TaskSubscriptionChannel returns the channel to listen for tasks from this service

type StatusType

type StatusType uint

StatusType of the service

const (
	STOPPED StatusType = 0
	PARTIAL StatusType = 1
	RUNNING 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) Descriptor() ([]byte, []int)

func (*Task) GetDescription

func (m *Task) GetDescription() string

func (*Task) GetFees

func (m *Task) GetFees() *Fee

func (*Task) GetInputs

func (m *Task) GetInputs() map[string]*Parameter

func (*Task) GetName

func (m *Task) GetName() string

func (*Task) GetOutputs

func (m *Task) GetOutputs() map[string]*Output

func (*Task) GetPayable

func (m *Task) GetPayable() bool

func (*Task) GetVerifiable

func (m *Task) GetVerifiable() bool

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) Reset

func (m *Task) Reset()

func (*Task) String

func (m *Task) String() string

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL