Documentation
¶
Overview ¶
Package rest implements REST API methods for remotely managing govisor.
Index ¶
- Constants
- type Client
- func (c *Client) ClearService(name string) error
- func (c *Client) DisableService(name string) error
- func (c *Client) EnableService(name string) error
- func (c *Client) GetLog(name string) (*LogInfo, error)
- func (c *Client) GetService(name string) (*ServiceInfo, error)
- func (c *Client) RestartService(name string) error
- func (c *Client) Services() ([]string, error)
- func (c *Client) SetAuth(user string, pass string)
- func (c *Client) Watch(ctx context.Context, etag string) (string, error)
- func (c *Client) WatchLog(ctx context.Context, name string, last *LogInfo) (*LogInfo, error)
- func (c *Client) WatchService(ctx context.Context, name string, last *ServiceInfo) (*ServiceInfo, error)
- type Error
- type LogInfo
- type LogRecord
- type ManagerInfo
- type ServiceInfo
Constants ¶
View Source
const ( // PollHeader should be set to the last Etag on an incoming request. // If set we will wait until the resource has an ETag that is different // from the supplied value, yielding a form of long polling. // This is only valid with GET requests. Note that the service may // return early without actually waiting, even if the ETag has not // changed. Typically there is a default timeout of around a minute // to make sure that the client is alive and well. PollEtagHeader = "X-Govisor-Poll-Etag" PollTimeHeader = "X-Govisor-Poll-Time" )
View Source
const (
MimeJson = "application/json; charset=UTF-8"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient returns a Client handle. The transport maybe nil to use a default transport, but it may also be adjusted to support additional options such as TLS. baseURI is the base URL to use.
func (*Client) ClearService ¶
func (*Client) DisableService ¶
func (*Client) EnableService ¶
func (*Client) GetService ¶
func (c *Client) GetService(name string) (*ServiceInfo, error)
func (*Client) RestartService ¶
func (*Client) WatchService ¶
func (c *Client) WatchService(ctx context.Context, name string, last *ServiceInfo) (*ServiceInfo, error)
type LogInfo ¶
type LogInfo struct {
Records []LogRecord
// contains filtered or unexported fields
}
type ManagerInfo ¶
type ServiceInfo ¶
type ServiceInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Enabled bool `json:"enabled"`
Running bool `json:"running"`
Failed bool `json:"failed"`
Provides []string `json:"provides"`
Depends []string `json:"depends"`
Conflicts []string `json:"conflicts"`
Status string `json:"status"`
TimeStamp time.Time `json:"tstamp"`
Serial string `json:"serial"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.