service

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALIVE     = iota
	TOMBSTONE = iota
	UNHEALTHY = iota
	UNKNOWN   = iota
)

Variables

This section is empty.

Functions

func StatusString

func StatusString(status int) string

Types

type Port

type Port struct {
	Type        string
	Port        int64
	ServicePort int64
	IP          string
}

func (*Port) MarshalJSON added in v1.3.0

func (mj *Port) MarshalJSON() ([]byte, error)

func (*Port) MarshalJSONBuf added in v1.3.0

func (mj *Port) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Port) UnmarshalJSON added in v1.3.0

func (uj *Port) UnmarshalJSON(input []byte) error

func (*Port) UnmarshalJSONFFLexer added in v1.3.0

func (uj *Port) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

type Service

type Service struct {
	ID        string
	Name      string
	Image     string
	Created   time.Time
	Hostname  string
	Ports     []Port
	Updated   time.Time
	ProxyMode string
	Status    int
}

func Decode

func Decode(data []byte) *Service

func ToService

func ToService(container *docker.APIContainers, ip string) Service

Format an APIContainers struct into a more compact struct we can ship over the wire in a broadcast.

func (*Service) Encode

func (svc *Service) Encode() ([]byte, error)

func (*Service) Format

func (svc *Service) Format() string

func (*Service) Invalidates

func (svc *Service) Invalidates(otherSvc *Service) bool

func (*Service) IsAlive

func (svc *Service) IsAlive() bool

func (*Service) IsTombstone

func (svc *Service) IsTombstone() bool

func (*Service) ListenerName added in v1.3.0

func (svc *Service) ListenerName() string

ListenerName returns the string name this service should be identified by as a listener to Sidecar state

func (*Service) MarshalJSON added in v1.3.0

func (mj *Service) MarshalJSON() ([]byte, error)

func (*Service) MarshalJSONBuf added in v1.3.0

func (mj *Service) MarshalJSONBuf(buf fflib.EncodingBuffer) error

func (*Service) PortForServicePort

func (svc *Service) PortForServicePort(findPort int64, pType string) int64

Look up a (usually Docker) mapped Port for a service by ServicePort

func (*Service) StatusString

func (svc *Service) StatusString() string

func (*Service) Tombstone

func (svc *Service) Tombstone()

func (*Service) UnmarshalJSON added in v1.3.0

func (uj *Service) UnmarshalJSON(input []byte) error

func (*Service) UnmarshalJSONFFLexer added in v1.3.0

func (uj *Service) UnmarshalJSONFFLexer(fs *fflib.FFLexer, state fflib.FFParseState) error

Jump to

Keyboard shortcuts

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