Documentation ¶
Overview ¶
Code generated by "make api"; DO NOT EDIT.
Code generated by "make api"; DO NOT EDIT.
Code generated by "make api"; DO NOT EDIT.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Addr() string
- func (c *Client) Clone() *Client
- func (c *Client) Do(r *retryablehttp.Request) (*Response, error)
- func (c *Client) NewRequest(ctx context.Context, method, requestPath string, body interface{}, ...) (*retryablehttp.Request, error)
- func (c *Client) RecoveryKmsWrapper() wrapping.Wrapper
- func (c *Client) SetAddr(addr string) error
- func (c *Client) SetBackoff(backoff retryablehttp.Backoff)
- func (c *Client) SetCheckRetry(checkRetry retryablehttp.CheckRetry)
- func (c *Client) SetClientTimeout(timeout time.Duration)
- func (c *Client) SetHeaders(headers http.Header)
- func (c *Client) SetLimiter(rateLimit float64, burst int)
- func (c *Client) SetMaxRetries(retries int)
- func (c *Client) SetOutputCurlString(curl bool)
- func (c *Client) SetRecoveryKmsWrapper(wrapper wrapping.Wrapper)
- func (c *Client) SetTLSConfig(conf *TLSConfig) error
- func (c *Client) SetToken(token string)
- func (c *Client) Token() string
- type Config
- type Error
- type ErrorDetails
- type FieldError
- type GenericDeleteResult
- type GenericListResult
- type GenericResult
- type Option
- type OutputStringError
- type Response
- type TLSConfig
Constants ¶
const EnvBoundaryAddr = "BOUNDARY_ADDR"
const EnvBoundaryCACert = "BOUNDARY_CACERT"
const EnvBoundaryCAPath = "BOUNDARY_CAPATH"
const EnvBoundaryClientCert = "BOUNDARY_CLIENT_CERT"
const EnvBoundaryClientKey = "BOUNDARY_CLIENT_KEY"
const EnvBoundaryClientTimeout = "BOUNDARY_CLIENT_TIMEOUT"
const EnvBoundaryMaxRetries = "BOUNDARY_MAX_RETRIES"
const EnvBoundaryRateLimit = "BOUNDARY_RATE_LIMIT"
const EnvBoundarySRVLookup = "BOUNDARY_SRV_LOOKUP"
const EnvBoundaryTLSInsecure = "BOUNDARY_TLS_INSECURE"
const EnvBoundaryTLSServerName = "BOUNDARY_TLS_SERVER_NAME"
const EnvBoundaryToken = "BOUNDARY_TOKEN"
const (
ErrOutputStringRequest = "output a string, please"
)
Variables ¶
var ( ErrNotFound = &Error{Status: http.StatusNotFound, Code: codes.NotFound.String()} ErrInvalidArgument = &Error{Status: http.StatusBadRequest, Code: codes.InvalidArgument.String()} ErrPermissionDenied = &Error{Status: http.StatusForbidden, Code: codes.PermissionDenied.String()} )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client to the Boundary API. Create a client with NewClient.
func NewClient ¶
NewClient returns a new client for the given configuration.
If the configuration is nil, Boundary will use configuration from DefaultConfig(), which is the recommended starting configuration.
If the environment variable `BOUNDARY_TOKEN` is present, the token will be automatically added to the client. Otherwise, you must manually call `SetToken()`.
func (*Client) Clone ¶
Clone creates a new client with the same configuration. Note that the same underlying http.Client is used; modifying the client from more than one goroutine at once may not be safe, so modify the client as needed and then clone.
func (*Client) Do ¶
func (c *Client) Do(r *retryablehttp.Request) (*Response, error)
Do takes a properly configured request and applies client configuration to it, returning the response.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(ctx context.Context, method, requestPath string, body interface{}, opt ...Option) (*retryablehttp.Request, error)
NewRequest creates a new raw request object to query the Boundary controller configured for this client. This is an advanced method and generally doesn't need to be called externally.
func (*Client) RecoveryKmsWrapper ¶
RecoveryKmsWrapper gets the configured recovery KMS wrapper.
func (*Client) SetAddr ¶
Sets the address of Boundary in the client. The format of address should be "<Scheme>://<Host>:<Port>". Setting this on a client will override the value of the BOUNDARY_ADDR environment variable.
func (*Client) SetBackoff ¶
func (c *Client) SetBackoff(backoff retryablehttp.Backoff)
SetBackoff sets the backoff function to be used for future requests.
func (*Client) SetCheckRetry ¶
func (c *Client) SetCheckRetry(checkRetry retryablehttp.CheckRetry)
SetCheckRetry sets the CheckRetry function to be used for future requests.
func (*Client) SetClientTimeout ¶
SetClientTimeout sets the client request timeout
func (*Client) SetHeaders ¶
SetHeaders clears all previous headers and uses only the given ones going forward.
func (*Client) SetLimiter ¶
SetLimiter will set the rate limiter for this client. This method is thread-safe. rateLimit and burst are specified according to https://godoc.org/golang.org/x/time/rate#NewLimiter
func (*Client) SetMaxRetries ¶
SetMaxRetries sets the number of retries that will be used in the case of certain errors
func (*Client) SetOutputCurlString ¶
func (*Client) SetRecoveryKmsWrapper ¶
SetRecoveryKmsWrapper sets the wrapper used for the recovery workflow
func (*Client) SetTLSConfig ¶
SetTLSConfig sets the TLS parameters to use and calls ConfigureTLS
type Config ¶
type Config struct { // Addr is the address of the Boundary controller. This should be a // complete URL such as "http://boundary.example.com". If you need a custom // SSL cert or want to enable insecure mode, you need to specify a custom // HttpClient. Addr string // Token is the client token that reuslts from authentication and can be // used to make calls into Boundary Token string // RecoveryKmsWrapper is a wrapper used in the recovery KMS authentication // flow. If set, this will always be used to generate a new token value // per-call, regardless of any value set in Token. RecoveryKmsWrapper wrapping.Wrapper // HttpClient is the HTTP client to use. Boundary sets sane defaults for the // http.Client and its associated http.Transport created in DefaultConfig. // If you must modify Boundary's defaults, it is suggested that you start // with that client and modify as needed rather than start with an empty // client (or http.DefaultClient). Currently if the client is cloned the // same HttpClient is used. HttpClient *http.Client // TLSConfig contains TLS configuration information. After modifying these // values, ConfigureTLS should be called. TLSConfig *TLSConfig // Headers contains extra headers that will be added to any request Headers http.Header // MaxRetries controls the maximum number of times to retry when a 5xx // error occurs. Set to 0 to disable retrying. Defaults to 2 (for a total // of three tries). MaxRetries int // Timeout is for setting custom timeout parameter in the HttpClient Timeout time.Duration // The Backoff function to use; a default is used if not provided Backoff retryablehttp.Backoff // The CheckRetry function to use; a default is used if not provided CheckRetry retryablehttp.CheckRetry // Limiter is the rate limiter used by the client. If this pointer is nil, // then there will be no limit set. In contrast, if this pointer is set, // even to an empty struct, then that limiter will be used. Note that an // empty Limiter is equivalent blocking all events. Currently if the client // is cloned the same limiter is used. Limiter *rate.Limiter // OutputCurlString causes the actual request to return an error of type // *OutputStringError. Type asserting the error message will allow // fetching a cURL-compatible string for the operation. OutputCurlString bool // SRVLookup enables the client to lookup the host through DNS SRV lookup SRVLookup bool }
Config is used to configure the creation of the client
func DefaultConfig ¶
DefaultConfig returns a default configuration for the client. It is safe to modify the return value of this function.
The default Addr is http://127.0.0.1:9200, but this can be overridden by setting the `BOUNDARY_ADDR` environment variable.
If an error is encountered, this will return nil.
func (*Config) ConfigureTLS ¶
ConfigureTLS takes a set of TLS configurations and applies those to the the HTTP client.
func (*Config) ReadEnvironment ¶
ReadEnvironment reads configuration information from the environment. If there is an error, no configuration value is updated.
type Error ¶
type Error struct { Status int32 `json:"status,omitempty"` Code string `json:"code,omitempty"` Message string `json:"message,omitempty"` Details *ErrorDetails `json:"details,omitempty"` // contains filtered or unexported fields }
func AsServerError ¶
AsServerError returns an api *Error from the provided error. If the provided error is not an api Error nil is returned instead.
func (*Error) Is ¶
Errors are considered the same iff they are both api.Errors and their statuses are the same.
func (Error) ResponseBody ¶
func (Error) ResponseMap ¶
type ErrorDetails ¶
type ErrorDetails struct { TraceId string `json:"TraceId,omitempty"` RequestId string `json:"request_id,omitempty"` ErrorId string `json:"error_id,omitempty"` RequestFields []*FieldError `json:"request_fields,omitempty"` }
type FieldError ¶
type GenericDeleteResult ¶
type GenericListResult ¶
type GenericResult ¶
type OutputStringError ¶
type OutputStringError struct { *retryablehttp.Request // contains filtered or unexported fields }
var (
LastOutputStringError *OutputStringError
)
func (*OutputStringError) CurlString ¶
func (d *OutputStringError) CurlString() string
func (*OutputStringError) Error ¶
func (d *OutputStringError) Error() string
type Response ¶
type Response struct { Body *bytes.Buffer Map map[string]interface{} // contains filtered or unexported fields }
Response is a custom response that wraps an HTTP response. Body will be populated with a buffer containing the response body after Decode is called; it will be nil if the response was a 204.
func (*Response) HttpResponse ¶
HttpResponse returns the underlying HTTP response
type TLSConfig ¶
type TLSConfig struct { // CACert is the path to a PEM-encoded CA cert file to use to verify the // Boundary server SSL certificate. CACert string // CAPath is the path to a directory of PEM-encoded CA cert files to verify // the Boundary server SSL certificate. CAPath string // ClientCert is the path to the certificate for Boundary communication ClientCert string // ClientKey is the path to the private key for Boundary communication ClientKey string // ServerName, if set, is used to set the SNI host when connecting via // TLS. ServerName string // Insecure enables or disables SSL verification Insecure bool }
TLSConfig contains the parameters needed to configure TLS on the HTTP client used to communicate with Boundary.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
internal
|
|
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |
Code generated by "make api"; DO NOT EDIT.
|
Code generated by "make api"; DO NOT EDIT. |