fusis

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: 20 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

type Balancer interface {
	GetServices() ([]types.Service, error)
	AddService(*types.Service) error
	GetService(name string) (*types.Service, error)
	DeleteService(string) error

	AddDestination(*types.Service, *types.Destination) error
	// GetDestination(name string) (*types.Destination, error)
	GetDestinations(svc *types.Service) ([]types.Destination, error)
	DeleteDestination(*types.Destination) error

	AddCheck(check types.CheckSpec) error
	DeleteCheck(check types.CheckSpec) error

	IsLeader() bool

	Shutdown()
}

func NewBalancer

func NewBalancer(config *config.BalancerConfig) (Balancer, error)

NewBalancer initializes a new balancer TODO: Graceful shutdown on initialization errors

type FusisBalancer

type FusisBalancer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Balancer represents the Load Balancer

func (*FusisBalancer) AddCheck

func (b *FusisBalancer) AddCheck(check types.CheckSpec) error

func (*FusisBalancer) AddDestination

func (b *FusisBalancer) AddDestination(svc *types.Service, dst *types.Destination) error

func (*FusisBalancer) AddService

func (b *FusisBalancer) AddService(svc *types.Service) error

AddService ...

func (*FusisBalancer) DeleteCheck

func (b *FusisBalancer) DeleteCheck(check types.CheckSpec) error

func (*FusisBalancer) DeleteDestination

func (b *FusisBalancer) DeleteDestination(dst *types.Destination) error

func (*FusisBalancer) DeleteService

func (b *FusisBalancer) DeleteService(name string) error

func (*FusisBalancer) GetDestinations

func (b *FusisBalancer) GetDestinations(svc *types.Service) ([]types.Destination, error)

func (*FusisBalancer) GetService

func (b *FusisBalancer) GetService(name string) (*types.Service, error)

GetService get a service

func (*FusisBalancer) GetServices

func (b *FusisBalancer) GetServices() ([]types.Service, error)

GetServices get all services

func (*FusisBalancer) IsLeader

func (b *FusisBalancer) IsLeader() bool

func (*FusisBalancer) Shutdown

func (b *FusisBalancer) Shutdown()

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