Documentation ¶
Index ¶
- Constants
- func AllToEmpty(s string) string
- func EmptyToAll(s string) string
- func Error(w http.ResponseWriter, req *http.Request, err error)
- func ErrorStatusCode(code string) int
- func FromErrorStatusCode(code int) string
- type Client
- type ErrorResponse
- type ProxyService
- func (s *ProxyService) CreateProxy(ctx context.Context, proxy *batproxy.Proxy, opts batproxy.CreateProxyOptions) error
- func (s *ProxyService) DeleteProxy(ctx context.Context, proxyID string) error
- func (s *ProxyService) ListProxies(ctx context.Context, opts batproxy.ListProxiesOptions) (*batproxy.ListProxiesPage, error)
- func (s *ProxyService) UpdateProxy(req *restful.Request, res *restful.Response)
- type Server
Constants ¶
View Source
const ShutdownTimeout = 1 * time.Second
ShutdownTimeout is the time given for outstanding requests to finish before shutdown.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, req *http.Request, err error)
Error prints & optionally logs an error message.
func ErrorStatusCode ¶
ErrorStatusCode returns the associated HTTP status code for a BatProxy error code.
func FromErrorStatusCode ¶
FromErrorStatusCode returns the associated BatProxy code for an HTTP status code.
Types ¶
type Client ¶
type Client struct { URL string // contains filtered or unexported fields }
Client represents an HTTP client.
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse represents a JSON structure for error output.
type ProxyService ¶
type ProxyService struct {
Client *Client
}
func NewProxyService ¶
func NewProxyService(client *Client) *ProxyService
func (*ProxyService) CreateProxy ¶
func (s *ProxyService) CreateProxy(ctx context.Context, proxy *batproxy.Proxy, opts batproxy.CreateProxyOptions) error
func (*ProxyService) DeleteProxy ¶
func (s *ProxyService) DeleteProxy(ctx context.Context, proxyID string) error
func (*ProxyService) ListProxies ¶
func (s *ProxyService) ListProxies(ctx context.Context, opts batproxy.ListProxiesOptions) (*batproxy.ListProxiesPage, error)
func (*ProxyService) UpdateProxy ¶
func (s *ProxyService) UpdateProxy(req *restful.Request, res *restful.Response)
Click to show internal directories.
Click to hide internal directories.