service

package
Version: v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: Apache-2.0 Imports: 6 Imported by: 105

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Id string `param:"id"`
	// Acl is present for backwards compatability, and should not be written to.
	// Instead, write to the "Acl" key in Config
	Acl    string            `param:"acl"`
	Config map[string]string `param:"config"`
}

type ServiceRepr added in v0.2.20

type ServiceRepr interface {
	Service() Service
	Serialize() ([]byte, error)
}

func ParseServiceRepr added in v0.2.20

func ParseServiceRepr(body []byte, path string) (repr ServiceRepr, err error)

ParseServiceRepr attempts parse using each of the ReprParsers in turn. Returns the first result to not error, or the error from the last parser

func ParseV1ServiceRepr added in v0.2.20

func ParseV1ServiceRepr(body []byte, path string) (repr ServiceRepr, err error)

func ParseV2ServiceRepr added in v0.2.20

func ParseV2ServiceRepr(body []byte, path string) (ServiceRepr, error)

type Storage added in v0.2.20

type Storage interface {
	All() ([]Service, error)
	Upsert(service Service) error
	Delete(serviceId string) error
}

The storage primitives required by Bamboo from the storage backend

type V1ServiceRepr added in v0.2.20

type V1ServiceRepr struct {
	ID  string
	Acl string
}

func (*V1ServiceRepr) Serialize added in v0.2.20

func (v1 *V1ServiceRepr) Serialize() ([]byte, error)

func (*V1ServiceRepr) Service added in v0.2.20

func (v1 *V1ServiceRepr) Service() Service

type V2ServiceRepr added in v0.2.20

type V2ServiceRepr struct {
	ID      string            `json:"-"`
	Version string            `json:"version"` // 2 is only valid version for V2ServiceRepr
	Config  map[string]string `json:"config"`
}

func MakeV2ServiceRepr added in v0.2.20

func MakeV2ServiceRepr(service Service) *V2ServiceRepr

func NewV2ServiceRepr added in v0.2.20

func NewV2ServiceRepr(appID string, config map[string]string) *V2ServiceRepr

func (*V2ServiceRepr) Serialize added in v0.2.20

func (v2 *V2ServiceRepr) Serialize() ([]byte, error)

func (*V2ServiceRepr) Service added in v0.2.20

func (v2 *V2ServiceRepr) Service() Service

type ZKStorage added in v0.2.20

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

func NewZKStorage added in v0.2.20

func NewZKStorage(conn *zk.Conn, conf conf.Zookeeper) (s *ZKStorage, err error)

func (*ZKStorage) All added in v0.2.20

func (z *ZKStorage) All() (services []Service, err error)

func (*ZKStorage) Delete added in v0.2.20

func (z *ZKStorage) Delete(serviceId string) error

func (*ZKStorage) Upsert added in v0.2.20

func (z *ZKStorage) Upsert(service Service) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL