Documentation ¶
Index ¶
- Constants
- func BulkRegisterApps(data types.M) error
- func BulkRegisterDatabases(data types.M) error
- func DecrementServiceLoad(service, url string) error
- func FetchAllApps() (map[string]string, error)
- func FetchAllDatabases() (map[string]string, error)
- func FetchAppNode(appName string) (string, error)
- func FetchAppServer(appName string) (string, error)
- func FetchDbNode(dbName string) (string, error)
- func FetchDbServer(dbName string) (string, error)
- func FetchServiceInstances(service string) ([]string, error)
- func FetchWorkerInstances() ([]string, error)
- func GetLeastLoadedInstance(service string) (string, error)
- func GetLeastLoadedInstances(service string, count int64) ([]string, error)
- func GetLeastLoadedInstancesWithScores(service string, count int64) ([]redis.Z, error)
- func GetLeastLoadedWorker() (string, error)
- func GetSSHPort(url string) (string, error)
- func IncrementServiceLoad(service, url string) error
- func RegisterApp(appName, nodeURL, serverURL string) error
- func RegisterDB(dbName, nodeURL, serverURL string) error
- func RegisterService(service, url string, score float64) error
- func RemoveApp(appName string) error
- func RemoveDB(dbName string) error
- func RemoveServiceInstance(service, member string) error
Constants ¶
const ( // ApplicationKey is the key name for the HashMap containing application instances ApplicationKey string = "applications" // DatabaseKey is the key name for the HashMap containing database instances DatabaseKey string = "databases" // SSHKey is the key name for the Sorted Set containing ssh microservice instances SSHKey string = types.GenSSH // WorkerInstanceKey is the key name for Worker nodes WorkerInstanceKey string = types.AppMaker // ErrEmptySet is the error message when the redis set being queried is empty ErrEmptySet string = "Empty Set" )
Variables ¶
This section is empty.
Functions ¶
func BulkRegisterApps ¶
BulkRegisterApps registers multiple apps at once
func BulkRegisterDatabases ¶
BulkRegisterDatabases registers multiple databases at once
func DecrementServiceLoad ¶
DecrementServiceLoad decrements the number of apps deployed on a service host by 1
func FetchAllApps ¶
FetchAllApps returns all applications along with their URLs (IP of the node and port)
func FetchAllDatabases ¶
FetchAllDatabases gets all the apps with their URL (IP of the node and port)
func FetchAppNode ¶
FetchAppNode returns the URL of the node where the application is deployed
func FetchAppServer ¶
FetchAppServer returns the URL of deployed application
func FetchDbNode ¶
FetchDbNode returns the URL of the node where the database is deployed
func FetchDbServer ¶
FetchDbServer returns the URL of the database's server
func FetchServiceInstances ¶
FetchServiceInstances returns all instances of a given service
func FetchWorkerInstances ¶
FetchWorkerInstances returns all worker service instances
func GetLeastLoadedInstance ¶
GetLeastLoadedInstance returns a single instance having least number of apps of a particular service deployed
func GetLeastLoadedInstances ¶
GetLeastLoadedInstances returns the URL of the host currently having the least number of apps of a particular service deployed
func GetLeastLoadedInstancesWithScores ¶
GetLeastLoadedInstancesWithScores returns the n least loaded instances along with their scores
func GetLeastLoadedWorker ¶
GetLeastLoadedWorker returns a single worker instance having least number of apps deployed
func GetSSHPort ¶
GetSSHPort returns the port of an instance where its ssh service is deployed
func IncrementServiceLoad ¶
IncrementServiceLoad increments the number of apps deployed on a service host by 1
func RegisterApp ¶
RegisterApp registers the app in the applications HashMap with its server and node url
func RegisterDB ¶
RegisterDB registers the database in the databases HashMap with its server and node url
func RegisterService ¶
RegisterService puts a service URL in its respective sorted set
func RemoveServiceInstance ¶
RemoveServiceInstance removes an instance of a particular service
Types ¶
This section is empty.