Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DialCedar ¶
func DialCedar(ctx context.Context, client *http.Client, opts DialCedarOptions) (*grpc.ClientConn, error)
DialCedar is a convenience function for creating a RPC client connection with cedar via gRPC. This wraps the same function in aviation.
func NewPaginatedReadCloser ¶
func NewPaginatedReadCloser(ctx context.Context, resp *http.Response, opts GetOptions) *paginatedReadCloser
NewPaginatedReadCloser returns an io.ReadCloser implementation for paginated HTTP responses from a Cedar service. It is safe to pass in a non-paginated response, thus the caller need not check for the appropriate header keys. GetOptions is used to make any subsequent page requests.
Types ¶
type ConnectionOptions ¶
type ConnectionOptions struct { DialOpts DialCedarOptions Client http.Client }
ConnectionOptions contains the options needed to create a gRPC connection with cedar.
func (ConnectionOptions) Validate ¶
func (opts ConnectionOptions) Validate() error
type DialCedarOptions ¶
type DialCedarOptions services.DialCedarOptions
DialCedarOptions describes the options for the DialCedar function. The base address defaults to `cedar.mongodb.com` and the RPC port to 7070. If a base address is provided the RPC port must also be provided. Username and either password or API key must always be provided. This aliases the same type in aviation.
type GetOptions ¶
type GetOptions struct { // The Cedar service's base HTTP URL for the request. BaseURL string // The user cookie for Cedar authorization. Optional. Cookie *http.Cookie // User API key and name for request header. UserKey string UserName string // HTTP client for connecting to the Cedar service. Optional. HTTPClient *http.Client }
GetOptions specify the required and optional information to create an HTTP GET request to Cedar.
func (GetOptions) DoReq ¶
func (opts GetOptions) DoReq(ctx context.Context, url string, body io.Reader) (*http.Response, error)
DoReq makes an HTTP request to the Cedar service.
func (GetOptions) Validate ¶
func (opts GetOptions) Validate() error
Validate ensures GetOptions is configured correctly.