Documentation
¶
Index ¶
- func NewAPIServer(databaseAdapter model.DatabaseAdapter) error
- func RootCmd() *cobra.Command
- type EtcdClient
- func (e *EtcdClient) Delete(key string) error
- func (e *EtcdClient) Get(key string) (string, error)
- func (e *EtcdClient) HealthCheck() error
- func (e *EtcdClient) Patch(key, value string) error
- func (e *EtcdClient) Put(key, value string) error
- func (e *EtcdClient) Watch(key string, stopChan <-chan struct{}) (<-chan clientv3.WatchResponse, error)
- type GoBGPClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAPIServer ¶
func NewAPIServer(databaseAdapter model.DatabaseAdapter) error
NewAPIServer initializes and runs a new API server on port 8080. It returns an error if the server fails to start.
Types ¶
type EtcdClient ¶
type EtcdClient struct {
// contains filtered or unexported fields
}
func NewEtcdClient ¶
func NewEtcdClient(config *model.APIConfig) (*EtcdClient, error)
func (*EtcdClient) Delete ¶
func (e *EtcdClient) Delete(key string) error
func (*EtcdClient) HealthCheck ¶
func (e *EtcdClient) HealthCheck() error
HealthCheck verifies the health status of the etcd client by querying the status of the first endpoint. It returns an error if the health check fails, indicating that the etcd client may be unreachable.
func (*EtcdClient) Patch ¶
func (e *EtcdClient) Patch(key, value string) error
func (*EtcdClient) Put ¶
func (e *EtcdClient) Put(key, value string) error
func (*EtcdClient) Watch ¶
func (e *EtcdClient) Watch(key string, stopChan <-chan struct{}) (<-chan clientv3.WatchResponse, error)
Watch sets up a watch operation on a specified key and streams events through a channel until the stop signal is received. The stopChan is used to terminate the watch operation by canceling the associated context.
type GoBGPClient ¶
type GoBGPClient struct {
// contains filtered or unexported fields
}
GoBGPClient is struct for manage GoBGP client
func NewGoBGPClient ¶
func NewGoBGPClient(config *model.APIConfig) (*GoBGPClient, error)
NewGoBGPClient initializes the new GoBGP client
func (*GoBGPClient) AddAnnouncement ¶
func (g *GoBGPClient) AddAnnouncement(announcement model.Announcement) error
TODO: AddAnnouncement needs to be completed AddAnnouncement adds a BGP announcement based on the given Announcement structure.