otn

package
v0.0.0-...-da19eeb Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Microservice

type Microservice interface {
	Start(api api.BitsharesAPI)
	Stop()
	SignalHandler(s os.Signal)
}

Microservice interface represents a basic contract for every service that wants to perform in OTN infrastructure

type Starter

type Starter struct {
	// contains filtered or unexported fields
}

Starter deals with OTN infrastructure

func NewStarter

func NewStarter(service Microservice, cfg *StarterConfig) *Starter

NewStarter creates properly initialized Starter object

func (*Starter) Run

func (a *Starter) Run(doneChan chan struct{}) error

Run interaction with OTN infrastructure (API and Consul)

type StarterConfig

type StarterConfig struct {
	InstanceLock string `json:"instance_lock"`
	TrustedNode  string `json:"trusted_node"`
	Username     string `json:"username"`
	Password     string `json:"password"`
}

StarterConfig specifies all necessary data for proper OTN API init

type StarterEvent

type StarterEvent int

StarterEvent shows OTN infrastructure event type

const (
	StarterEventExit StarterEvent = iota
	StarterEventAPIConnected
	StarterEventAPIDisconnected
	StarterEventLocked
	StarterEventUnlocked
)

Possible events from OTN infrastructure

Jump to

Keyboard shortcuts

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