Documentation
¶
Index ¶
- Constants
- type AWS
- type AWSRegionStorageImpl
- func (cs *AWSRegionStorageImpl) AddAWSRegionAndStore(region *models.AwsRegion) error
- func (cs *AWSRegionStorageImpl) AddAWSRegionsAndStore(regions storagetype.AWSRegions) error
- func (cs *AWSRegionStorageImpl) GetAWSRegions() storagetype.AWSRegions
- func (cs *AWSRegionStorageImpl) Load() error
- func (cs *AWSRegionStorageImpl) RemoveAWSRegionAndStore(region *models.AwsRegion) error
- func (cs *AWSRegionStorageImpl) ReplaceAllAWSRegionsAndStore(regions storagetype.AWSRegions) error
- func (cs *AWSRegionStorageImpl) Store() error
- type Cluster
- type ClusterModeStorage
- type Consul
- type SDAWStorage
- type SDConsulStorage
- type Storable
- type Storage
- type Users
Constants ¶
View Source
const (
AWSRegionFileName = "service_discovery/aws.json"
)
View Source
const (
ClusterModeDataFileName = "cluster.json"
)
View Source
const (
ConsulFileName = "service_discovery/consul.json"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWS ¶
type AWS interface { // GetAWS does not load the AWSRegions from the storage. Use Load() to load the them if needed. GetAWSRegions() storagetype.AWSRegions // AddAWSRegionsAndStore adds a list of AWSRegions to the storage and stores in the storage file. AddAWSRegionsAndStore(AWS storagetype.AWSRegions) error // AddAWSRegionAndStore adds a new AWSRegion to the storage and stores in the storage file. AddAWSRegionAndStore(AWS *models.AwsRegion) error // RemoveAWSAndStore removes a AWSRegion from the storage and stores in the storage file. RemoveAWSRegionAndStore(AWS *models.AwsRegion) error // ReplaceAllAWSRegionsAndStore replaces the list of AWSRegions in the storage and stores in the storage file. ReplaceAllAWSRegionsAndStore(AWS storagetype.AWSRegions) error }
type AWSRegionStorageImpl ¶
type AWSRegionStorageImpl struct { AWSData storagetype.AWSRegionData // contains filtered or unexported fields }
func (*AWSRegionStorageImpl) AddAWSRegionAndStore ¶
func (cs *AWSRegionStorageImpl) AddAWSRegionAndStore(region *models.AwsRegion) error
func (*AWSRegionStorageImpl) AddAWSRegionsAndStore ¶
func (cs *AWSRegionStorageImpl) AddAWSRegionsAndStore(regions storagetype.AWSRegions) error
func (*AWSRegionStorageImpl) GetAWSRegions ¶
func (cs *AWSRegionStorageImpl) GetAWSRegions() storagetype.AWSRegions
func (*AWSRegionStorageImpl) Load ¶
func (cs *AWSRegionStorageImpl) Load() error
func (*AWSRegionStorageImpl) RemoveAWSRegionAndStore ¶
func (cs *AWSRegionStorageImpl) RemoveAWSRegionAndStore(region *models.AwsRegion) error
func (*AWSRegionStorageImpl) ReplaceAllAWSRegionsAndStore ¶
func (cs *AWSRegionStorageImpl) ReplaceAllAWSRegionsAndStore(regions storagetype.AWSRegions) error
func (*AWSRegionStorageImpl) Store ¶
func (cs *AWSRegionStorageImpl) Store() error
type Cluster ¶
type Cluster interface { // GetCluster does not load the data from the storage. Use Load() to load the data if needed. GetCluster() *storagetype.Cluster // GetStatus does not load the data from the storage. Use Load() to load the data if needed. GetStatus() *string // SetClusterAndStore adds a new cluster to the storage and stores in the storage file. SetClusterAndStore(cluster *storagetype.Cluster) error // SetStatusAndStore sets a new status to the storage and stores in the storage file. SetStatusAndStore(status *string) error // UnsetClusterAndStore removes a cluster from the storage and stores in the storage file. UnsetClusterAndStore() error }
type ClusterModeStorage ¶
type ClusterModeStorage interface { Cluster Users Load() error Store() error // IsClusterMode returns true if the storage is in cluster mode, false otherwise. // i.e. if ClusterModeData are not empty IsClusterMode() bool }
func NewClusterModeStorage ¶
func NewClusterModeStorage(path string) (ClusterModeStorage, error)
NewClusterModeStorage creates a new clusterStorageImpl with initial configuration from a file path.
type Consul ¶
type Consul interface { // GetConsuls does not load the consuls from the storage. Use Load() to load the them if needed. GetConsuls() storagetype.Consuls // AddConsulsAndStore adds a list of consuls to the storage and stores in the storage file. AddConsulsAndStore(consuls storagetype.Consuls) error // AddConsulAndStore adds a new consul to the storage and stores in the storage file. AddConsulAndStore(consul *models.Consul) error // RemoveConsulAndStore removes a consul from the storage and stores in the storage file. RemoveConsulAndStore(consul *models.Consul) error // ReplaceAllConsulsAndStore replaces the list of consuls in the storage and stores in the storage file. ReplaceAllConsulsAndStore(consuls storagetype.Consuls) error }
type SDAWStorage ¶
func NewSDAWSRegionStorage ¶
func NewSDAWSRegionStorage(path string) (SDAWStorage, error)
NewSDAWSRegionStorage creates a new AWSRegionStorageImpl with initial configuration from a file path.
type SDConsulStorage ¶
func NewSDConsulStorage ¶
func NewSDConsulStorage(path string) (SDConsulStorage, error)
NewSDConsulStorage creates a new consulStorageImpl with initial configuration from a file path.
type Storable ¶
type Storable interface { storagetype.ClusterModeData | storagetype.ConsulData | storagetype.AWSRegionData }
type constraint for storable objects, add more when need arises with |
type Users ¶
type Users interface { // GetUsers does not load the users from the storage. Use Load() to load the users if needed. GetUsers() storagetype.Users // AddUsersAndStore adds a list of users to the storage and stores in the storage file. AddUsersAndStore(users storagetype.Users) error // AddUserAndStore adds a new user to the storage and stores in the storage file. AddUserAndStore(user storagetype.User) error // RemoveUserAndStore removes a user from the storage and stores in the storage file. RemoveUserAndStore(user storagetype.User) error // ReplaceAllUsersAndStore replaces the list of users in the storage and stores in the storage file. ReplaceAllUsersAndStore(users storagetype.Users) error }
Click to show internal directories.
Click to hide internal directories.