Documentation ¶
Index ¶
- func NotAllowed(c *gin.Context)
- func NotFound(c *gin.Context)
- type APIAuthentication
- type APIKey
- type APIKeyList
- type APIv1
- func (s *APIv1) APIKeyCreate(ctx context.Context, in *APIKey) (out *APIKey, err error)
- func (s *APIv1) APIKeyDelete(ctx context.Context, id string) (err error)
- func (s *APIv1) APIKeyDetail(ctx context.Context, id string) (out *APIKey, err error)
- func (s *APIv1) APIKeyList(ctx context.Context, in *PageQuery) (out *APIKeyList, err error)
- func (s *APIv1) APIKeyUpdate(ctx context.Context, in *APIKey) (out *APIKey, err error)
- func (s *APIv1) Authenticate(ctx context.Context, in *APIAuthentication) (out *LoginReply, err error)
- func (s *APIv1) Do(req *http.Request, data interface{}, checkStatus bool) (rep *http.Response, err error)
- func (s *APIv1) Login(ctx context.Context, in *LoginRequest) (out *LoginReply, err error)
- func (s *APIv1) NewRequest(ctx context.Context, method, path string, data interface{}, params *url.Values) (req *http.Request, err error)
- func (s *APIv1) Refresh(ctx context.Context) (out *LoginReply, err error)
- func (s *APIv1) Register(ctx context.Context, in *RegisterRequest) (out *RegisterReply, err error)
- func (s *APIv1) Status(ctx context.Context) (out *StatusReply, err error)
- type ClientOption
- type LoginReply
- type LoginRequest
- type OpenIDConfiguration
- type PageQuery
- type QuarterdeckClient
- type RegisterReply
- type RegisterRequest
- type Reply
- type StatusReply
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NotAllowed ¶
NotAllowed returns a JSON 405 response for the API.
Types ¶
type APIAuthentication ¶
type APIKey ¶
type APIKey struct { ID int `json:"id,omitempty"` ClientID string `json:"client_id"` ClientSecret string `json:"client_secret,omitempty"` Name string `json:"name"` ProjectID string `json:"project_id"` Owner string `json:"owner,omitempty"` Permissions []string `json:"permissions,omitempty"` Created string `json:"created,omitempty"` Modified string `json:"modified,omitempty"` }
type APIKeyList ¶
type APIv1 ¶
type APIv1 struct {
// contains filtered or unexported fields
}
APIv1 implements the QuarterdeckClient interface
func (*APIv1) APIKeyCreate ¶
func (*APIv1) APIKeyDelete ¶
func (*APIv1) APIKeyDetail ¶
func (*APIv1) APIKeyList ¶
func (*APIv1) APIKeyUpdate ¶
func (*APIv1) Authenticate ¶
func (s *APIv1) Authenticate(ctx context.Context, in *APIAuthentication) (out *LoginReply, err error)
func (*APIv1) Do ¶
func (s *APIv1) Do(req *http.Request, data interface{}, checkStatus bool) (rep *http.Response, err error)
Do executes an http request against the server, performs error checking, and deserializes the response data into the specified struct.
func (*APIv1) Login ¶
func (s *APIv1) Login(ctx context.Context, in *LoginRequest) (out *LoginReply, err error)
func (*APIv1) NewRequest ¶
func (*APIv1) Register ¶
func (s *APIv1) Register(ctx context.Context, in *RegisterRequest) (out *RegisterReply, err error)
type ClientOption ¶
ClientOption allows us to configure the APIv1 client when it is created.
func WithClient ¶
func WithClient(client *http.Client) ClientOption
type LoginReply ¶
type LoginRequest ¶
type OpenIDConfiguration ¶ added in v0.1.1
type OpenIDConfiguration struct { Issuer string `json:"issuer"` AuthorizationEP string `json:"authorization_endpoint"` TokenEP string `json:"token_endpoint"` DeviceAuthorizationEP string `json:"device_authorization_endpoint"` UserInfoEP string `json:"userinfo_endpoint"` MFAChallengeEP string `json:"mfa_challenge_endpoint"` JWKSURI string `json:"jwks_uri"` RegistrationEP string `json:"registration_endpoint"` RevocationEP string `json:"revocation_endpoint"` ScopesSupported []string `json:"scopes_supported"` ResponseTypesSupported []string `json:"response_types_supported"` CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported"` ResponseModesSupported []string `json:"response_modes_supported"` SubjectTypesSupported []string `json:"subject_types_supported"` IDTokenSigningAlgValues []string `json:"id_token_signing_alg_values_supported"` TokenEndpointAuthMethods []string `json:"token_endpoint_auth_methods_supported"` ClaimsSupported []string `json:"claims_supported"` RequestURIParameterSupported bool `json:"request_uri_parameter_supported"` }
type PageQuery ¶
type PageQuery struct { PageSize int `json:"page_size" url:"page_size,omitempty" form:"page_size"` NextPageToken string `json:"next_page_token" url:"next_page_token,omitempty" form:"next_page_token"` }
PageQuery manages paginated list requests.
type QuarterdeckClient ¶
type QuarterdeckClient interface { // Unauthenticated endpoints Status(context.Context) (*StatusReply, error) Register(context.Context, *RegisterRequest) (*RegisterReply, error) Login(context.Context, *LoginRequest) (*LoginReply, error) Authenticate(context.Context, *APIAuthentication) (*LoginReply, error) // Authenticated endpoints Refresh(context.Context) (*LoginReply, error) // API Keys Resource APIKeyList(context.Context, *PageQuery) (*APIKeyList, error) APIKeyCreate(context.Context, *APIKey) (*APIKey, error) APIKeyDetail(context.Context, string) (*APIKey, error) APIKeyUpdate(context.Context, *APIKey) (*APIKey, error) APIKeyDelete(context.Context, string) error }
func New ¶
func New(endpoint string, opts ...ClientOption) (_ QuarterdeckClient, err error)
New creates a new API v1 client that implements the Quarterdeck Client interface.
type RegisterReply ¶
type RegisterRequest ¶
type Reply ¶
Reply contains standard fields that are used for generic API responses and errors.
func ErrorResponse ¶
func ErrorResponse(err interface{}) Reply
Construct a new response for an error or simply return unsuccessful.
type StatusReply ¶
type StatusReply struct { Status string `json:"status"` Uptime string `json:"uptime,omitempty"` Version string `json:"version,omitempty"` }
Returned on status requests.
Click to show internal directories.
Click to hide internal directories.