api

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APICommonFunc

type APICommonFunc struct{}

func (*APICommonFunc) MakeDeletedSubResource

func (a *APICommonFunc) MakeDeletedSubResource(deleteKey []string, LbModel LoxiModel) (string, error)

func (*APICommonFunc) MakeQueryParam

func (a *APICommonFunc) MakeQueryParam(LbModel LoxiModel) (map[string]string, error)

type EpSelect

type EpSelect uint

type HealthCheckAPI

type HealthCheckAPI struct {
	APICommonFunc
	// contains filtered or unexported fields
}

func (*HealthCheckAPI) Create

func (h *HealthCheckAPI) Create(ctx context.Context, lbModel LoxiModel) error

func (*HealthCheckAPI) Delete

func (h *HealthCheckAPI) Delete(ctx context.Context, lbModel LoxiModel) error

func (*HealthCheckAPI) Get

func (h *HealthCheckAPI) Get(ctx context.Context, name string) (LoxiModel, error)

func (*HealthCheckAPI) List

func (h *HealthCheckAPI) List(ctx context.Context) (LoxiModel, error)

type LbMode

type LbMode int32

type LoadBalancerAPI

type LoadBalancerAPI struct {
	APICommonFunc
	// contains filtered or unexported fields
}

func (*LoadBalancerAPI) Create

func (l *LoadBalancerAPI) Create(ctx context.Context, lbModel LoxiModel) error

func (*LoadBalancerAPI) Delete

func (l *LoadBalancerAPI) Delete(ctx context.Context, lbModel LoxiModel) error

func (*LoadBalancerAPI) Get

func (l *LoadBalancerAPI) Get(ctx context.Context, name string) (LoxiModel, error)

func (*LoadBalancerAPI) GetListModel

func (l *LoadBalancerAPI) GetListModel() LoxiModel

func (*LoadBalancerAPI) GetModel

func (l *LoadBalancerAPI) GetModel() LoxiModel

func (*LoadBalancerAPI) List

func (l *LoadBalancerAPI) List(ctx context.Context) (LoxiModel, error)

type LoadBalancerEndpoint

type LoadBalancerEndpoint struct {
	EndpointIP string `json:"endpointIP"`
	TargetPort uint16 `json:"targetPort"`
	Weight     uint8  `json:"weight"`
	State      string `json:"state"`
}

type LoadBalancerListModel

type LoadBalancerListModel struct {
	Item []LoadBalancerModel `json:"lbAttr"`
}

func (*LoadBalancerListModel) GetKeyStruct

func (lbListModel *LoadBalancerListModel) GetKeyStruct() LoxiModel

type LoadBalancerModel

type LoadBalancerModel struct {
	Service      LoadBalancerService    `json:"serviceArguments"`
	SecondaryIPs []LoadBalancerSecIp    `json:"secondaryIPs"`
	Endpoints    []LoadBalancerEndpoint `json:"endpoints"`
}

func (*LoadBalancerModel) GetKeyStruct

func (lbModel *LoadBalancerModel) GetKeyStruct() LoxiModel

type LoadBalancerSecIp

type LoadBalancerSecIp struct {
	SecondaryIP string `json:"secondaryIP"`
}

type LoadBalancerService

type LoadBalancerService struct {
	ExternalIP string   `json:"externalIP" key:"externalipaddress"`
	Port       uint16   `json:"port" key:"port"`
	Protocol   string   `json:"protocol" key:"protocol"`
	Sel        EpSelect `json:"sel"`
	Mode       LbMode   `json:"mode"`
	BGP        bool     `json:"BGP" options:"bgp"`
	Monitor    bool     `json:"Monitor"`
	Timeout    uint32   `json:"inactiveTimeOut"`
	Block      uint16   `json:"block" options:"block"`
}

func (*LoadBalancerService) GetKeyStruct

func (lbService *LoadBalancerService) GetKeyStruct() LoxiModel

type LoxiAPI

type LoxiAPI interface {
	Get(context.Context, string) (LoxiModel, error)
	List(context.Context) (LoxiModel, error)
	Create(context.Context, LoxiModel) error
	Delete(context.Context, LoxiModel) error
}

type LoxiClient

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

func NewLoxiClient

func NewLoxiClient(apiServer string) (*LoxiClient, error)

apiServer is string. what format? http://10.0.0.1 or 10.0.0.1

func (*LoxiClient) GetRESTClient

func (l *LoxiClient) GetRESTClient() *RESTClient

func (*LoxiClient) HealthCheck

func (l *LoxiClient) HealthCheck() *HealthCheckAPI

func (*LoxiClient) LoadBalancer

func (l *LoxiClient) LoadBalancer() *LoadBalancerAPI

func (*LoxiClient) SetLoxiHealthCheckChan

func (l *LoxiClient) SetLoxiHealthCheckChan(stop <-chan struct{}, aliveCh chan *LoxiClient)

type LoxiModel

type LoxiModel interface {
	GetKeyStruct() LoxiModel
}

type LoxiRequest

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

func NewLoxiRequest

func NewLoxiRequest(method, resource string, client *RESTClient) *LoxiRequest

func (*LoxiRequest) Body

func (l *LoxiRequest) Body(obj LoxiModel) *LoxiRequest

func (*LoxiRequest) Do

func (*LoxiRequest) Query

func (l *LoxiRequest) Query(param map[string]string) *LoxiRequest

func (*LoxiRequest) SubResource

func (l *LoxiRequest) SubResource(subresources ...string) *LoxiRequest

func (*LoxiRequest) URL

func (l *LoxiRequest) URL() *url.URL

URL make REST API url

type LoxiResponse

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

func (*LoxiResponse) UnMarshal

func (l *LoxiResponse) UnMarshal(obj LoxiModel) *LoxiResponse

type RESTClient

type RESTClient struct {
	Client *http.Client
	// contains filtered or unexported fields
}

func NewRESTClient

func NewRESTClient(baseURL *url.URL, provider, version string, client *http.Client) (*RESTClient, error)

func (*RESTClient) CreateRequest

func (r *RESTClient) CreateRequest(method string, resource string) *LoxiRequest

func (*RESTClient) DELETE

func (r *RESTClient) DELETE(resource string) *LoxiRequest

func (*RESTClient) GET

func (r *RESTClient) GET(resource string) *LoxiRequest

func (*RESTClient) GetBaseURL

func (r *RESTClient) GetBaseURL() string

func (*RESTClient) POST

func (r *RESTClient) POST(resource string) *LoxiRequest

Jump to

Keyboard shortcuts

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