core

package
v0.0.0-...-0178fca Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InventoryService

type InventoryService interface {
	RegisterService(name string, protocol string) (model.Service, error)
	UnregisterService(name string) (deleted bool, referer []string, err error)
	GetService(name string) (model.Service, bool, error)
	GetServiceNames() ([]string, error)
	AddServiceDependency(serviceName string, dependServiceNames string, egressPort uint32) error
	RemoveServiceDependency(serviceName string, dependServiceNames string) (bool, error)
	GetRefferersOf(serviceName string) ([]string, error)
	RegisterHost(serviceName, hostName, ingressAddr, substanceAddr, egressHost string) (model.Host, error)
	UnregisterHost(serviceName string, hostName string) (bool, error)
	GetHostByName(name string) (model.Host, bool, error)
	GetHostNames() ([]string, error)
	GetHostsOfService(serviceName string) ([]model.Host, error)
	UpdateHost(serviceName string, hostName string, ingressAddr, substanceAddr, egressHost *string) (host model.Host, err error)
	IdempotentService(serviceName string, param model.IdempotentServiceParam) (changed bool, err error)
}

InventoryService is domain service shich manages meshem inventories.

func NewInventoryService

func NewInventoryService(
	repo repository.InventoryRepository,
	discoery repository.DiscoveryRepository,
	versionGen VersionGenerator,
	logger *logrus.Logger,
) InventoryService

NewInventoryService creates an InventoryService instance.

type MockedVersionGen

type MockedVersionGen struct {
	Version       model.Version
	CompareResult int
}

MockedVersionGen is mock generator for testing

func (*MockedVersionGen) Compare

func (gen *MockedVersionGen) Compare(l, r model.Version) int

func (*MockedVersionGen) New

func (gen *MockedVersionGen) New() model.Version

type VersionGenerator

type VersionGenerator interface {
	New() model.Version
	Compare(l, r model.Version) int
}

func NewCurrentTimeGenerator

func NewCurrentTimeGenerator() VersionGenerator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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