request

package
v0.0.0-...-1f48b27 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CniRequest

type CniRequest struct {
	CniType         string    `json:"cni_type"`
	PodName         string    `json:"pod_name"`
	PodNamespace    string    `json:"pod_namespace"`
	ContainerID     string    `json:"container_id"`
	NetNs           string    `json:"net_ns"`
	IfName          string    `json:"if_name"`
	Provider        string    `json:"provider"`
	DefaultMaster   string    `json:"default_master"`
	IsMasterInNetNs bool      `json:"is_master_in_netns"`
	VtapType        string    `json:"vtap_type"`
	Routes          []Route   `json:"routes"`
	DNS             types.DNS `json:"dns"`
}

CniRequest is the cniserver request format

type CniResponse

type CniResponse struct {
	Protocol   string    `json:"protocol"`
	IpAddress  string    `json:"address"`
	MacAddress string    `json:"mac_address"`
	CIDR       string    `json:"cidr"`
	Gateway    string    `json:"gateway"`
	Mtu        int       `json:"mtu"`
	PodNicName string    `json:"nicname"`
	DNS        types.DNS `json:"dns"`
	Err        string    `json:"error"`
}

CniResponse is the cniserver response format

type CniServerClient

type CniServerClient struct {
	*gorequest.SuperAgent
}

CniServerClient is the client to visit cniserver

func NewCniServerClient

func NewCniServerClient(socketAddress string) CniServerClient

func (CniServerClient) Add

func (csc CniServerClient) Add(podRequest CniRequest) (*CniResponse, error)

Add pod request

func (CniServerClient) Del

func (csc CniServerClient) Del(podRequest CniRequest) error

Del pod request

type Route

type Route struct {
	Destination string `json:"dst"`
	Gateway     string `json:"gw"`
}

Route represents a requested route

Jump to

Keyboard shortcuts

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