store

package
v0.0.0-...-22c38b1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributedLocker

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

type FusisStore

type FusisStore struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*FusisStore) AddCheck

func (s *FusisStore) AddCheck(spec types.CheckSpec) error

func (*FusisStore) AddDestination

func (s *FusisStore) AddDestination(svc *types.Service, dst *types.Destination) error

func (*FusisStore) AddService

func (s *FusisStore) AddService(svc *types.Service) error

AddService adds a new services to store. It validates the name uniqueness and the IPVS uniqueness by saving the IPVS key in the store, which consists in a combination of address, port and protocol.

func (*FusisStore) AddWatcher

func (s *FusisStore) AddWatcher(ch chan state.State)

func (*FusisStore) Close

func (s *FusisStore) Close() error

func (*FusisStore) DeleteCheck

func (s *FusisStore) DeleteCheck(spec types.CheckSpec) error

func (*FusisStore) DeleteDestination

func (s *FusisStore) DeleteDestination(svc *types.Service, dst *types.Destination) error

func (*FusisStore) DeleteService

func (s *FusisStore) DeleteService(svc *types.Service) error

func (*FusisStore) GetCheck

func (s *FusisStore) GetCheck(serviceID string) (*types.CheckSpec, error)

func (*FusisStore) GetDestinations

func (s *FusisStore) GetDestinations(svc *types.Service) ([]types.Destination, error)

func (*FusisStore) GetService

func (s *FusisStore) GetService(name string) (*types.Service, error)

func (*FusisStore) GetServices

func (s *FusisStore) GetServices() ([]types.Service, error)

func (*FusisStore) GetState

func (s *FusisStore) GetState() (state.State, error)

func (*FusisStore) Watch

func (s *FusisStore) Watch()

type Store

type Store interface {
	GetState() (state.State, error)
	GetServices() ([]types.Service, error)
	GetService(name string) (*types.Service, error)
	AddService(svc *types.Service) error
	DeleteService(svc *types.Service) error

	GetDestinations(svc *types.Service) ([]types.Destination, error)
	AddDestination(svc *types.Service, dst *types.Destination) error
	DeleteDestination(svc *types.Service, dst *types.Destination) error

	AddCheck(check types.CheckSpec) error
	GetCheck(serviceID string) (*types.CheckSpec, error)
	DeleteCheck(check types.CheckSpec) error

	AddWatcher(ch chan state.State)
	Watch()

	Close() error
}

func New

func New(config *config.BalancerConfig) (Store, error)

Directories

Path Synopsis
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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