Documentation
¶
Index ¶
- type ChildCreateRequest
- type ChildCreateResponse
- type Client
- func (c *Client) ChildCreate(ctx context.Context, req *ChildCreateRequest) (*ChildCreateResponse, error)
- func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)
- func (c *Client) Find(ctx context.Context, req *FindRequest) (*FindResponse, error)
- func (c *Client) Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)
- func (c *Client) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)
- type DeleteRequest
- type DeleteResponse
- type FindRequest
- type FindResponse
- type HTTPClient
- type IndexRequest
- type IndexResponse
- type UpdateRequest
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChildCreateRequest ¶
type ChildCreateRequest struct { Tokenid string `url:"tokenid",json:"tokenid"` // User-specific token identifier. Userid string `url:"userid",json:"userid"` // User ID // The following parameters are optional Comment *string `url:"comment,omitempty",json:"comment,omitempty"` Expire *int `url:"expire,omitempty",json:"expire,omitempty"` // API token expiration date (seconds since epoch). '0' means no expiration date. Privsep *bool `url:"privsep,omitempty",json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user. }
type ChildCreateResponse ¶
type ChildCreateResponse struct { FullTokenid string `url:"full-tokenid",json:"full-tokenid"` // The full token id. Info struct { // The following parameters are optional Comment *string `url:"comment,omitempty",json:"comment,omitempty"` Expire *int `url:"expire,omitempty",json:"expire,omitempty"` // API token expiration date (seconds since epoch). '0' means no expiration date. Privsep *bool `url:"privsep,omitempty",json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user. } `url:"info",json:"info"` Value string `url:"value",json:"value"` // API token value used for authentication. }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(c HTTPClient) *Client
func (*Client) ChildCreate ¶
func (c *Client) ChildCreate(ctx context.Context, req *ChildCreateRequest) (*ChildCreateResponse, error)
ChildCreate Generate a new API token for a specific user. NOTE: returns API token value, which needs to be stored as it cannot be retrieved afterwards!
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, req *DeleteRequest) (*DeleteResponse, error)
Delete Remove API token for a specific user.
func (*Client) Find ¶
func (c *Client) Find(ctx context.Context, req *FindRequest) (*FindResponse, error)
Find Get specific API token information.
func (*Client) Index ¶
func (c *Client) Index(ctx context.Context, req *IndexRequest) (*IndexResponse, error)
Index Get user API tokens.
func (*Client) Update ¶
func (c *Client) Update(ctx context.Context, req *UpdateRequest) (*UpdateResponse, error)
Update Update API token for a specific user.
type DeleteRequest ¶
type DeleteResponse ¶
type DeleteResponse map[string]interface{}
type FindRequest ¶
type FindResponse ¶
type FindResponse struct { // The following parameters are optional Comment *string `url:"comment,omitempty",json:"comment,omitempty"` Expire *int `url:"expire,omitempty",json:"expire,omitempty"` // API token expiration date (seconds since epoch). '0' means no expiration date. Privsep *bool `url:"privsep,omitempty",json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user. }
type HTTPClient ¶
type IndexRequest ¶
type IndexRequest struct {
Userid string `url:"userid",json:"userid"` // User ID
}
type IndexResponse ¶
type IndexResponse []*struct { Tokenid string `url:"tokenid",json:"tokenid"` // User-specific token identifier. // The following parameters are optional Comment *string `url:"comment,omitempty",json:"comment,omitempty"` Expire *int `url:"expire,omitempty",json:"expire,omitempty"` // API token expiration date (seconds since epoch). '0' means no expiration date. Privsep *bool `url:"privsep,omitempty",json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user. }
type UpdateRequest ¶
type UpdateRequest struct { Tokenid string `url:"tokenid",json:"tokenid"` // User-specific token identifier. Userid string `url:"userid",json:"userid"` // User ID // The following parameters are optional Comment *string `url:"comment,omitempty",json:"comment,omitempty"` Expire *int `url:"expire,omitempty",json:"expire,omitempty"` // API token expiration date (seconds since epoch). '0' means no expiration date. Privsep *bool `url:"privsep,omitempty",json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user. }
type UpdateResponse ¶
type UpdateResponse struct { // The following parameters are optional Comment *string `url:"comment,omitempty",json:"comment,omitempty"` Expire *int `url:"expire,omitempty",json:"expire,omitempty"` // API token expiration date (seconds since epoch). '0' means no expiration date. Privsep *bool `url:"privsep,omitempty",json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user. }
Click to show internal directories.
Click to hide internal directories.