goapollo

package
v0.0.0-...-cf013b6 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApolloConfig

type ApolloConfig struct {
	ApolloConnConfig
	Configurations map[string]interface{} `json:"configurations"`
}

type ApolloConnConfig

type ApolloConnConfig struct {
	AppId         string `json:"appId"`
	Cluster       string `json:"cluster"`
	NamespaceName string `json:"namespaceName"`
	ReleaseKey    string `json:"releaseKey"`
}

type App

type App struct {
	AppId    string
	Clusters sync.Map
}

type Cluster

type Cluster struct {
	Name          string
	Namespaces    sync.Map
	Notifications sync.Map
}

type ConfigValue

type ConfigValue struct {
	Value string `json:"value"`
}

type Namespace

type Namespace struct {
	Value string
}

type Notification

type Notification struct {
	NamespaceName  string `json:"namespaceName"`
	NotificationId int64  `json:"notificationId"`
}

Notification NotificationId use to detect data updates

type Server

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

func NewServer

func NewServer(cfg *ServerConfig) (*Server, error)

func (*Server) AddApp

func (s *Server) AddApp(appId string) error

func (*Server) AddCluster

func (s *Server) AddCluster(appId string, clusterName string) error

func (*Server) AddNamespaceWithValue

func (s *Server) AddNamespaceWithValue(appId string, clusterName string, namespace string, value string) error

func (*Server) Close

func (s *Server) Close() error

Close shuts down the server.

func (*Server) DeleteApp

func (s *Server) DeleteApp(appId string) bool

func (*Server) DeleteCluster

func (s *Server) DeleteCluster(appId string, clusterName string) bool

func (*Server) DeleteNamespace

func (s *Server) DeleteNamespace(appId string, clusterName string, namespace string) bool

func (*Server) GetApp

func (s *Server) GetApp(appId string) (*App, bool)

func (*Server) GetApps

func (s *Server) GetApps() []*App

func (*Server) GetCluster

func (s *Server) GetCluster(appId string, clusterName string) (*Cluster, bool)

func (*Server) GetClusters

func (s *Server) GetClusters(appId string) ([]*Cluster, bool)

func (*Server) GetConfig

func (s *Server) GetConfig(appId string, clusterName string, namespace string) (string, bool)

func (*Server) Start

func (s *Server) Start() (int, error)

Start starts the server and returns the listen port.

func (*Server) UpdateNamespaceWithValue

func (s *Server) UpdateNamespaceWithValue(appId string, clusterName string, namespace string, value string) error

type ServerConfig

type ServerConfig struct {
	Port int
}

type ServicesConfig

type ServicesConfig struct {
	AppName     string `json:"appName"`
	InstanceId  string `json:"instanceId"`
	HomepageUrl string `json:"homepageUrl"`
}

Jump to

Keyboard shortcuts

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