apiserver

package
v0.0.0-...-c376657 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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.

func RootCmd

func RootCmd() *cobra.Command

RootCmd initializes and returns the root command for the CoreBGP API server application.

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) Get

func (e *EtcdClient) Get(key string) (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.

func (*GoBGPClient) Close

func (g *GoBGPClient) Close()

Close closes GoBGP API server connection

Jump to

Keyboard shortcuts

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