Documentation ¶
Index ¶
- Constants
- func AddRoutes(r *mux.Router, b *Backend)
- type Backend
- type BypassDriver
- type ComClient
- func (c *ComClient) DeleteInterface(ctx context.Context, id string) error
- func (c *ComClient) GetInterface(ctx context.Context, id string) (*ContainerInterfaces, error)
- func (c *ComClient) ListInterfaces(ctx context.Context) (map[string]ContainerInterfaces, error)
- func (c *ComClient) Ping(ctx context.Context) error
- func (c *ComClient) PostInterface(ctx context.Context, ifs *ContainerInterfaces) (*ContainerInterfaces, error)
- type ContainerInterfaces
- type HTTPStatusError
- type Interface
Constants ¶
View Source
const HTTPStatusErrorBodyMaxLength = 64 * 1024
HTTPStatusErrorBodyMaxLength specifies the maximum length of HTTPStatusError.Body
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
BypassDriver BypassDriver
}
type BypassDriver ¶
type BypassDriver interface { ListInterfaces() map[string]ContainerInterfaces GetInterface(id string) *ContainerInterfaces PostInterface(id string, containerIfs *ContainerInterfaces) DeleteInterface(id string) }
type ComClient ¶
type ComClient struct {
// contains filtered or unexported fields
}
func NewComClient ¶
func (*ComClient) DeleteInterface ¶
func (*ComClient) GetInterface ¶
func (*ComClient) ListInterfaces ¶
func (*ComClient) PostInterface ¶
func (c *ComClient) PostInterface(ctx context.Context, ifs *ContainerInterfaces) (*ContainerInterfaces, error)
type ContainerInterfaces ¶
type HTTPStatusError ¶
type HTTPStatusError struct { // StatusCode is non-2XX status code StatusCode int // Body is at most HTTPStatusErrorBodyMaxLength Body string }
HTTPStatusError is created from non-2XX HTTP response
func (*HTTPStatusError) Error ¶
func (e *HTTPStatusError) Error() string
Error implements error. If e.Body is a marshalled string of api.ErrorJSON, Error returns ErrorJSON.Message . Otherwise Error returns a human-readable string that contains e.StatusCode and e.Body.
Click to show internal directories.
Click to hide internal directories.