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) 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 FindRequest
 - type FindResponse
 - type HTTPClient
 - type IndexRequest
 - type IndexResponse
 - type Info
 - 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"`   // Full User ID, in the `name@realm` format.
	// 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 *util.PVEBool `url:"privsep,omitempty" json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
}
    type ChildCreateResponse ¶
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) 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 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 *util.PVEBool `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"` // Full User ID, in the `name@realm` format.
}
    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 *util.PVEBool `url:"privsep,omitempty" json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
}
    type Info ¶ added in v0.0.10
type 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 *util.PVEBool `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"`   // Full User ID, in the `name@realm` format.
	// 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 *util.PVEBool `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 *util.PVEBool `url:"privsep,omitempty" json:"privsep,omitempty"` // Restrict API token privileges with separate ACLs (default), or give full privileges of corresponding user.
}
    Updated token information.
 Click to show internal directories. 
   Click to hide internal directories.