portadapter

package
v0.0.0-...-d34c59c Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandGenerator

type CommandGenerator struct {
}

CommandGenerator ...

func NewCommandGenerator

func NewCommandGenerator() *CommandGenerator

NewCommandGenerator ...

func (*CommandGenerator) GenerateCommandsForApplicationServers

func (commandGenerator *CommandGenerator) GenerateCommandsForApplicationServers(serviceInfo *domain.ServiceInfo,
	eventID string) error

GenerateCommandsForApplicationServers ...

type IDGenerator

type IDGenerator struct {
}

IDGenerator ...

func NewIDGenerator

func NewIDGenerator() *IDGenerator

NewIDGenerator ...

func NewUUIIDGenerator

func NewUUIIDGenerator() *IDGenerator

NewUUIIDGenerator ...

func (*IDGenerator) NewID

func (idGenerator *IDGenerator) NewID() string

NewID generate new ID in domain id model/struct

type StorageEntity

type StorageEntity struct {
	sync.Mutex
	Db *badger.DB
	// contains filtered or unexported fields
}

StorageEntity ...

func NewStorageEntity

func NewStorageEntity(isInMemory bool, dbPath string, logging *logrus.Logger) (*StorageEntity, error)

NewStorageEntity ... do not forget defer Db.Close()!

func (*StorageEntity) GetAllApplicationServersIPWhoHaveTunnels

func (storageEntity *StorageEntity) GetAllApplicationServersIPWhoHaveTunnels() ([]string, error)

GetAllApplicationServersWhoHaveTunnels bad code :(

func (*StorageEntity) GetServiceInfo

func (storageEntity *StorageEntity) GetServiceInfo(serviceData *domain.ServiceInfo, eventID string) (*domain.ServiceInfo, error)

GetServiceInfo ...

func (*StorageEntity) LoadAllStorageDataToDomainModels

func (storageEntity *StorageEntity) LoadAllStorageDataToDomainModels() ([]*domain.ServiceInfo, error)

LoadAllStorageDataToDomainModels ...

func (*StorageEntity) LoadCacheFromStorage

func (storageEntity *StorageEntity) LoadCacheFromStorage(oldStorageEntity *StorageEntity) error

LoadCacheFromStorage ...

func (*StorageEntity) NewServiceInfoToStorage

func (storageEntity *StorageEntity) NewServiceInfoToStorage(serviceData *domain.ServiceInfo,
	eventID string) error

NewServiceInfoToStorage add new service to storage

func (*StorageEntity) ReadTunnelInfoForApplicationServer

func (storageEntity *StorageEntity) ReadTunnelInfoForApplicationServer(ip string) *domain.TunnelForApplicationServer

ReadTunnelInfoForApplicationServer return nil, if key not exist

func (*StorageEntity) RemoveAllTunnelsInfoForApplicationServer

func (storageEntity *StorageEntity) RemoveAllTunnelsInfoForApplicationServer(ip string) error

RemoveAllTunnelsInfoForApplicationServer

func (*StorageEntity) RemoveServiceInfoFromStorage

func (storageEntity *StorageEntity) RemoveServiceInfoFromStorage(serviceData *domain.ServiceInfo, eventID string) error

RemoveServiceInfoFromStorage ...

func (*StorageEntity) RemoveTunnelsInfoForApplicationServerFromStorage

func (storageEntity *StorageEntity) RemoveTunnelsInfoForApplicationServerFromStorage(ip string) error

RemoveTunnelsInfoForApplicationServerFromStorage ...

func (*StorageEntity) UpdateServiceInfo

func (storageEntity *StorageEntity) UpdateServiceInfo(serviceData *domain.ServiceInfo, eventID string) error

UpdateServiceInfo validate and update service

func (*StorageEntity) UpdateTunnelFilesInfoAtStorage

func (storageEntity *StorageEntity) UpdateTunnelFilesInfoAtStorage(tunnelsFilesInfo []*domain.TunnelForApplicationServer) error

UpdateTunnelFilesInfoAtStorage ...

type TunnelFileMaker

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

TunnelFileMaker ...

func NewTunnelFileMaker

func NewTunnelFileMaker(sysctlConfFilePath string,
	isMockMode bool,
	logging *logrus.Logger) *TunnelFileMaker

NewTunnelFileMaker ...

func (*TunnelFileMaker) CreateTunnel

func (tunnelFileMaker *TunnelFileMaker) CreateTunnel(tunnelFilesInfo *domain.TunnelForApplicationServer,
	createTunnelID string) error

CreateTunnel ...

func (*TunnelFileMaker) CreateTunnels

func (tunnelFileMaker *TunnelFileMaker) CreateTunnels(tunnelsFilesInfo []*domain.TunnelForApplicationServer,
	createTunnelID string) ([]*domain.TunnelForApplicationServer, error)

CreateTunnels ...

func (*TunnelFileMaker) RemoveAllTunnels

func (tunnelFileMaker *TunnelFileMaker) RemoveAllTunnels(tunnelsFilesInfo []*domain.TunnelForApplicationServer,
	removeTunnelID string) error

RemoveAllTunnels remove tunnels whithout any checks

func (*TunnelFileMaker) RemoveTunnel

func (tunnelFileMaker *TunnelFileMaker) RemoveTunnel(tunnelFilesInfo *domain.TunnelForApplicationServer,
	removeTunnelID string) error

RemoveTunnel ...

func (*TunnelFileMaker) RemoveTunnels

func (tunnelFileMaker *TunnelFileMaker) RemoveTunnels(tunnelsFilesInfo []*domain.TunnelForApplicationServer,
	removeTunnelID string) ([]*domain.TunnelForApplicationServer, error)

RemoveTunnels ...

type UUIDGenerator

type UUIDGenerator struct {
}

UUIDGenerator ...

func (*UUIDGenerator) NewID

func (uuidGenerator *UUIDGenerator) NewID() string

NewID generate new ID in domain id model/struct

Jump to

Keyboard shortcuts

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