request

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CniServerClient

type CniServerClient struct {
	*gorequest.SuperAgent
}

CniServerClient is the client to visit cniserver

func NewCniServerClient

func NewCniServerClient(socketAddress string) CniServerClient

NewCniServerClient return a new cniserverclient

func (CniServerClient) Add

func (csc CniServerClient) Add(podRequest PodRequest) (*PodResponse, error)

Add pod request

func (CniServerClient) Del

func (csc CniServerClient) Del(podRequest PodRequest) error

Del pod request

type PodRequest

type PodRequest struct {
	PodName      string `json:"pod_name"`
	PodNamespace string `json:"pod_namespace"`
	ContainerID  string `json:"container_id"`
	NetNs        string `json:"net_ns"`
}

PodRequest is the cniserver request format

type PodResponse

type PodResponse struct {
	IpAddress  string `json:"address"`
	MacAddress string `json:"mac_address"`
	CIDR       string `json:"cidr"`
	Gateway    string `json:"gateway"`
	Mtu        int    `json:"mtu"`
	Err        string `json:"error"`
}

PodResponse is the cniserver response format

Jump to

Keyboard shortcuts

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