service

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 15, 2019 License: MIT Imports: 10 Imported by: 35

Documentation

Index

Constants

View Source
const (
	ALIVE     = iota
	TOMBSTONE = iota
	UNHEALTHY = iota
	UNKNOWN   = iota
	DRAINING  = 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, error)

Decode decodes the input data JSON into a *Service. If it fails, it returns a non-nil error

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

func (svc *Service) IsDraining() 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

func (*Service) Version

func (svc *Service) Version() string

Version attempts to extract a version from the image. Otherwise it returns the full image name.

Jump to

Keyboard shortcuts

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