client

package
v0.42.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGetPayload

func BuildGetPayload(secretGetSecretName string, secretGetSecretType string, secretGetJWT string) (*secret.GetPayload, error)

BuildGetPayload builds the payload for the secret get endpoint from CLI flags.

func BuildListPayload

func BuildListPayload(secretListPage string, secretListFilter string, secretListOffset string, secretListLimit string, secretListJWT string) (*secret.ListPayload, error)

BuildListPayload builds the payload for the secret list endpoint from CLI flags.

func BuildSetPayload

func BuildSetPayload(secretSetBody string, secretSetJWT string) (*secret.SetPayload, error)

BuildSetPayload builds the payload for the secret set endpoint from CLI flags.

func DecodeGetResponse

func DecodeGetResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

DecodeGetResponse returns a decoder for responses returned by the secret get endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeGetResponse may return the following errors:

  • "bad-request" (type *secret.BadRequestT): http.StatusBadRequest
  • "invalid-parameter" (type *secret.InvalidParameterT): http.StatusUnprocessableEntity
  • "invalid-scopes" (type *secret.InvalidScopesT): http.StatusForbidden
  • "not-implemented" (type *secret.NotImplementedT): http.StatusNotImplemented
  • "not-found" (type *secret.ResourceNotFoundT): http.StatusNotFound
  • "not-available" (type *secret.ServiceNotAvailableT): http.StatusServiceUnavailable
  • "not-authorized" (type *secret.UnauthorizedT): http.StatusUnauthorized
  • error: internal error

func DecodeListResponse

func DecodeListResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

DecodeListResponse returns a decoder for responses returned by the secret list endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeListResponse may return the following errors:

  • "bad-request" (type *secret.BadRequestT): http.StatusBadRequest
  • "invalid-parameter" (type *secret.InvalidParameterT): http.StatusUnprocessableEntity
  • "invalid-scopes" (type *secret.InvalidScopesT): http.StatusForbidden
  • "not-implemented" (type *secret.NotImplementedT): http.StatusNotImplemented
  • "not-available" (type *secret.ServiceNotAvailableT): http.StatusServiceUnavailable
  • "not-authorized" (type *secret.UnauthorizedT): http.StatusUnauthorized
  • error: internal error

func DecodeSetResponse

func DecodeSetResponse(decoder func(*http.Response) goahttp.Decoder, restoreBody bool) func(*http.Response) (any, error)

DecodeSetResponse returns a decoder for responses returned by the secret set endpoint. restoreBody controls whether the response body should be restored after having been read. DecodeSetResponse may return the following errors:

  • "bad-request" (type *secret.BadRequestT): http.StatusBadRequest
  • "invalid-parameter" (type *secret.InvalidParameterT): http.StatusUnprocessableEntity
  • "invalid-scopes" (type *secret.InvalidScopesT): http.StatusForbidden
  • "not-implemented" (type *secret.NotImplementedT): http.StatusNotImplemented
  • "not-found" (type *secret.ResourceNotFoundT): http.StatusNotFound
  • "not-available" (type *secret.ServiceNotAvailableT): http.StatusServiceUnavailable
  • "not-authorized" (type *secret.UnauthorizedT): http.StatusUnauthorized
  • error: internal error

func EncodeGetRequest

func EncodeGetRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error

EncodeGetRequest returns an encoder for requests sent to the secret get server.

func EncodeListRequest

func EncodeListRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error

EncodeListRequest returns an encoder for requests sent to the secret list server.

func EncodeSetRequest

func EncodeSetRequest(encoder func(*http.Request) goahttp.Encoder) func(*http.Request, any) error

EncodeSetRequest returns an encoder for requests sent to the secret set server.

func GetSecretPath

func GetSecretPath() string

GetSecretPath returns the URL path to the secret service get HTTP endpoint.

func ListSecretPath

func ListSecretPath() string

ListSecretPath returns the URL path to the secret service list HTTP endpoint.

func NewGetBadRequest

func NewGetBadRequest(body *GetBadRequestResponseBody) *secret.BadRequestT

NewGetBadRequest builds a secret service get endpoint bad-request error.

func NewGetInvalidParameter

func NewGetInvalidParameter(body *GetInvalidParameterResponseBody) *secret.InvalidParameterT

NewGetInvalidParameter builds a secret service get endpoint invalid-parameter error.

func NewGetInvalidScopes

func NewGetInvalidScopes(body *GetInvalidScopesResponseBody) *secret.InvalidScopesT

NewGetInvalidScopes builds a secret service get endpoint invalid-scopes error.

func NewGetNotAuthorized

func NewGetNotAuthorized() *secret.UnauthorizedT

NewGetNotAuthorized builds a secret service get endpoint not-authorized error.

func NewGetNotAvailable

func NewGetNotAvailable() *secret.ServiceNotAvailableT

NewGetNotAvailable builds a secret service get endpoint not-available error.

func NewGetNotFound

func NewGetNotFound(body *GetNotFoundResponseBody) *secret.ResourceNotFoundT

NewGetNotFound builds a secret service get endpoint not-found error.

func NewGetNotImplemented

func NewGetNotImplemented(body *GetNotImplementedResponseBody) *secret.NotImplementedT

NewGetNotImplemented builds a secret service get endpoint not-implemented error.

func NewGetSecretResultTOK

func NewGetSecretResultTOK(body *GetResponseBody) *secret.SecretResultT

NewGetSecretResultTOK builds a "secret" service "get" endpoint result from a HTTP "OK" response.

func NewListBadRequest

func NewListBadRequest(body *ListBadRequestResponseBody) *secret.BadRequestT

NewListBadRequest builds a secret service list endpoint bad-request error.

func NewListInvalidParameter

func NewListInvalidParameter(body *ListInvalidParameterResponseBody) *secret.InvalidParameterT

NewListInvalidParameter builds a secret service list endpoint invalid-parameter error.

func NewListInvalidScopes

func NewListInvalidScopes(body *ListInvalidScopesResponseBody) *secret.InvalidScopesT

NewListInvalidScopes builds a secret service list endpoint invalid-scopes error.

func NewListNotAuthorized

func NewListNotAuthorized() *secret.UnauthorizedT

NewListNotAuthorized builds a secret service list endpoint not-authorized error.

func NewListNotAvailable

func NewListNotAvailable() *secret.ServiceNotAvailableT

NewListNotAvailable builds a secret service list endpoint not-available error.

func NewListNotImplemented

func NewListNotImplemented(body *ListNotImplementedResponseBody) *secret.NotImplementedT

NewListNotImplemented builds a secret service list endpoint not-implemented error.

func NewListResultOK

func NewListResultOK(body *ListResponseBody) *secret.ListResult

NewListResultOK builds a "secret" service "list" endpoint result from a HTTP "OK" response.

func NewSetBadRequest

func NewSetBadRequest(body *SetBadRequestResponseBody) *secret.BadRequestT

NewSetBadRequest builds a secret service set endpoint bad-request error.

func NewSetInvalidParameter

func NewSetInvalidParameter(body *SetInvalidParameterResponseBody) *secret.InvalidParameterT

NewSetInvalidParameter builds a secret service set endpoint invalid-parameter error.

func NewSetInvalidScopes

func NewSetInvalidScopes(body *SetInvalidScopesResponseBody) *secret.InvalidScopesT

NewSetInvalidScopes builds a secret service set endpoint invalid-scopes error.

func NewSetNotAuthorized

func NewSetNotAuthorized() *secret.UnauthorizedT

NewSetNotAuthorized builds a secret service set endpoint not-authorized error.

func NewSetNotAvailable

func NewSetNotAvailable() *secret.ServiceNotAvailableT

NewSetNotAvailable builds a secret service set endpoint not-available error.

func NewSetNotFound

func NewSetNotFound(body *SetNotFoundResponseBody) *secret.ResourceNotFoundT

NewSetNotFound builds a secret service set endpoint not-found error.

func NewSetNotImplemented

func NewSetNotImplemented(body *SetNotImplementedResponseBody) *secret.NotImplementedT

NewSetNotImplemented builds a secret service set endpoint not-implemented error.

func SetSecretPath

func SetSecretPath() string

SetSecretPath returns the URL path to the secret service set HTTP endpoint.

func ValidateGetBadRequestResponseBody

func ValidateGetBadRequestResponseBody(body *GetBadRequestResponseBody) (err error)

ValidateGetBadRequestResponseBody runs the validations defined on get_bad-request_response_body

func ValidateGetInvalidParameterResponseBody

func ValidateGetInvalidParameterResponseBody(body *GetInvalidParameterResponseBody) (err error)

ValidateGetInvalidParameterResponseBody runs the validations defined on get_invalid-parameter_response_body

func ValidateGetInvalidScopesResponseBody

func ValidateGetInvalidScopesResponseBody(body *GetInvalidScopesResponseBody) (err error)

ValidateGetInvalidScopesResponseBody runs the validations defined on get_invalid-scopes_response_body

func ValidateGetNotFoundResponseBody

func ValidateGetNotFoundResponseBody(body *GetNotFoundResponseBody) (err error)

ValidateGetNotFoundResponseBody runs the validations defined on get_not-found_response_body

func ValidateGetNotImplementedResponseBody

func ValidateGetNotImplementedResponseBody(body *GetNotImplementedResponseBody) (err error)

ValidateGetNotImplementedResponseBody runs the validations defined on get_not-implemented_response_body

func ValidateGetResponseBody

func ValidateGetResponseBody(body *GetResponseBody) (err error)

ValidateGetResponseBody runs the validations defined on GetResponseBody

func ValidateLinkTResponseBody

func ValidateLinkTResponseBody(body *LinkTResponseBody) (err error)

ValidateLinkTResponseBody runs the validations defined on LinkTResponseBody

func ValidateListBadRequestResponseBody

func ValidateListBadRequestResponseBody(body *ListBadRequestResponseBody) (err error)

ValidateListBadRequestResponseBody runs the validations defined on list_bad-request_response_body

func ValidateListInvalidParameterResponseBody

func ValidateListInvalidParameterResponseBody(body *ListInvalidParameterResponseBody) (err error)

ValidateListInvalidParameterResponseBody runs the validations defined on list_invalid-parameter_response_body

func ValidateListInvalidScopesResponseBody

func ValidateListInvalidScopesResponseBody(body *ListInvalidScopesResponseBody) (err error)

ValidateListInvalidScopesResponseBody runs the validations defined on list_invalid-scopes_response_body

func ValidateListNotImplementedResponseBody

func ValidateListNotImplementedResponseBody(body *ListNotImplementedResponseBody) (err error)

ValidateListNotImplementedResponseBody runs the validations defined on list_not-implemented_response_body

func ValidateListResponseBody

func ValidateListResponseBody(body *ListResponseBody) (err error)

ValidateListResponseBody runs the validations defined on ListResponseBody

func ValidateSecretListItemResponseBody

func ValidateSecretListItemResponseBody(body *SecretListItemResponseBody) (err error)

ValidateSecretListItemResponseBody runs the validations defined on SecretListItemResponseBody

func ValidateSetBadRequestResponseBody

func ValidateSetBadRequestResponseBody(body *SetBadRequestResponseBody) (err error)

ValidateSetBadRequestResponseBody runs the validations defined on set_bad-request_response_body

func ValidateSetInvalidParameterResponseBody

func ValidateSetInvalidParameterResponseBody(body *SetInvalidParameterResponseBody) (err error)

ValidateSetInvalidParameterResponseBody runs the validations defined on set_invalid-parameter_response_body

func ValidateSetInvalidScopesResponseBody

func ValidateSetInvalidScopesResponseBody(body *SetInvalidScopesResponseBody) (err error)

ValidateSetInvalidScopesResponseBody runs the validations defined on set_invalid-scopes_response_body

func ValidateSetNotFoundResponseBody

func ValidateSetNotFoundResponseBody(body *SetNotFoundResponseBody) (err error)

ValidateSetNotFoundResponseBody runs the validations defined on set_not-found_response_body

func ValidateSetNotImplementedResponseBody

func ValidateSetNotImplementedResponseBody(body *SetNotImplementedResponseBody) (err error)

ValidateSetNotImplementedResponseBody runs the validations defined on set_not-implemented_response_body

Types

type Client

type Client struct {
	// List Doer is the HTTP client used to make requests to the list endpoint.
	ListDoer goahttp.Doer

	// Get Doer is the HTTP client used to make requests to the get endpoint.
	GetDoer goahttp.Doer

	// Set Doer is the HTTP client used to make requests to the set endpoint.
	SetDoer goahttp.Doer

	// CORS Doer is the HTTP client used to make requests to the  endpoint.
	CORSDoer goahttp.Doer

	// RestoreResponseBody controls whether the response bodies are reset after
	// decoding so they can be read again.
	RestoreResponseBody bool
	// contains filtered or unexported fields
}

Client lists the secret service endpoint HTTP clients.

func NewClient

func NewClient(
	scheme string,
	host string,
	doer goahttp.Doer,
	enc func(*http.Request) goahttp.Encoder,
	dec func(*http.Response) goahttp.Decoder,
	restoreBody bool,
) *Client

NewClient instantiates HTTP clients for all the secret service servers.

func (*Client) BuildGetRequest

func (c *Client) BuildGetRequest(ctx context.Context, v any) (*http.Request, error)

BuildGetRequest instantiates a HTTP request object with method and path set to call the "secret" service "get" endpoint

func (*Client) BuildListRequest

func (c *Client) BuildListRequest(ctx context.Context, v any) (*http.Request, error)

BuildListRequest instantiates a HTTP request object with method and path set to call the "secret" service "list" endpoint

func (*Client) BuildSetRequest

func (c *Client) BuildSetRequest(ctx context.Context, v any) (*http.Request, error)

BuildSetRequest instantiates a HTTP request object with method and path set to call the "secret" service "set" endpoint

func (*Client) Get

func (c *Client) Get() goa.Endpoint

Get returns an endpoint that makes HTTP requests to the secret service get server.

func (*Client) List

func (c *Client) List() goa.Endpoint

List returns an endpoint that makes HTTP requests to the secret service list server.

func (*Client) Set

func (c *Client) Set() goa.Endpoint

Set returns an endpoint that makes HTTP requests to the secret service set server.

type GetBadRequestResponseBody

type GetBadRequestResponseBody struct {
	// Information message
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

GetBadRequestResponseBody is the type of the "secret" service "get" endpoint HTTP response body for the "bad-request" error.

type GetInvalidParameterResponseBody

type GetInvalidParameterResponseBody struct {
	// message describing expected type or pattern.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// name of parameter.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// provided parameter value.
	Value *string `form:"value,omitempty" json:"value,omitempty" xml:"value,omitempty"`
}

GetInvalidParameterResponseBody is the type of the "secret" service "get" endpoint HTTP response body for the "invalid-parameter" error.

type GetInvalidScopesResponseBody

type GetInvalidScopesResponseBody struct {
	// ID of involved resource
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message of error
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

GetInvalidScopesResponseBody is the type of the "secret" service "get" endpoint HTTP response body for the "invalid-scopes" error.

type GetNotFoundResponseBody

type GetNotFoundResponseBody struct {
	// ID of missing resource
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message of error
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

GetNotFoundResponseBody is the type of the "secret" service "get" endpoint HTTP response body for the "not-found" error.

type GetNotImplementedResponseBody

type GetNotImplementedResponseBody struct {
	// Information message
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

GetNotImplementedResponseBody is the type of the "secret" service "get" endpoint HTTP response body for the "not-implemented" error.

type GetResponseBody

type GetResponseBody struct {
	// Secret name
	SecretName *string `form:"secret-name,omitempty" json:"secret-name,omitempty" xml:"secret-name,omitempty"`
	// Secret value
	SecretValue *string `form:"secret-value,omitempty" json:"secret-value,omitempty" xml:"secret-value,omitempty"`
	// Expiry time
	ExpiryTime *int64 `form:"expiry-time,omitempty" json:"expiry-time,omitempty" xml:"expiry-time,omitempty"`
}

GetResponseBody is the type of the "secret" service "get" endpoint HTTP response body.

type LinkTResponseBody

type LinkTResponseBody struct {
	// relation type
	Rel *string `form:"rel,omitempty" json:"rel,omitempty" xml:"rel,omitempty"`
	// mime type
	Type *string `form:"type,omitempty" json:"type,omitempty" xml:"type,omitempty"`
	// web link
	Href *string `form:"href,omitempty" json:"href,omitempty" xml:"href,omitempty"`
}

LinkTResponseBody is used to define fields on response body types.

type ListBadRequestResponseBody

type ListBadRequestResponseBody struct {
	// Information message
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

ListBadRequestResponseBody is the type of the "secret" service "list" endpoint HTTP response body for the "bad-request" error.

type ListInvalidParameterResponseBody

type ListInvalidParameterResponseBody struct {
	// message describing expected type or pattern.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// name of parameter.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// provided parameter value.
	Value *string `form:"value,omitempty" json:"value,omitempty" xml:"value,omitempty"`
}

ListInvalidParameterResponseBody is the type of the "secret" service "list" endpoint HTTP response body for the "invalid-parameter" error.

type ListInvalidScopesResponseBody

type ListInvalidScopesResponseBody struct {
	// ID of involved resource
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message of error
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

ListInvalidScopesResponseBody is the type of the "secret" service "list" endpoint HTTP response body for the "invalid-scopes" error.

type ListNotImplementedResponseBody

type ListNotImplementedResponseBody struct {
	// Information message
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

ListNotImplementedResponseBody is the type of the "secret" service "list" endpoint HTTP response body for the "not-implemented" error.

type ListResponseBody

type ListResponseBody struct {
	// secrets
	Items []*SecretListItemResponseBody `form:"items,omitempty" json:"items,omitempty" xml:"items,omitempty"`
	Links []*LinkTResponseBody          `form:"links,omitempty" json:"links,omitempty" xml:"links,omitempty"`
}

ListResponseBody is the type of the "secret" service "list" endpoint HTTP response body.

type SecretListItemResponseBody

type SecretListItemResponseBody struct {
	// Secret name
	SecretName *string `form:"secret-name,omitempty" json:"secret-name,omitempty" xml:"secret-name,omitempty"`
	// Expiry time
	ExpiryTime *int64 `form:"expiry-time,omitempty" json:"expiry-time,omitempty" xml:"expiry-time,omitempty"`
}

SecretListItemResponseBody is used to define fields on response body types.

type SetBadRequestResponseBody

type SetBadRequestResponseBody struct {
	// Information message
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

SetBadRequestResponseBody is the type of the "secret" service "set" endpoint HTTP response body for the "bad-request" error.

type SetInvalidParameterResponseBody

type SetInvalidParameterResponseBody struct {
	// message describing expected type or pattern.
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// name of parameter.
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// provided parameter value.
	Value *string `form:"value,omitempty" json:"value,omitempty" xml:"value,omitempty"`
}

SetInvalidParameterResponseBody is the type of the "secret" service "set" endpoint HTTP response body for the "invalid-parameter" error.

type SetInvalidScopesResponseBody

type SetInvalidScopesResponseBody struct {
	// ID of involved resource
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message of error
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

SetInvalidScopesResponseBody is the type of the "secret" service "set" endpoint HTTP response body for the "invalid-scopes" error.

type SetNotFoundResponseBody

type SetNotFoundResponseBody struct {
	// ID of missing resource
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Message of error
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

SetNotFoundResponseBody is the type of the "secret" service "set" endpoint HTTP response body for the "not-found" error.

type SetNotImplementedResponseBody

type SetNotImplementedResponseBody struct {
	// Information message
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
}

SetNotImplementedResponseBody is the type of the "secret" service "set" endpoint HTTP response body for the "not-implemented" error.

type SetRequestBody

type SetRequestBody struct {
	// Secret name
	SecretName string `form:"secret-name" json:"secret-name" xml:"secret-name"`
	// Secret type
	SecretType *string `form:"secret-type,omitempty" json:"secret-type,omitempty" xml:"secret-type,omitempty"`
	// Secret value
	SecretValue string `form:"secret-value" json:"secret-value" xml:"secret-value"`
	// Expiry time
	ExpiryTime int64 `form:"expiry-time" json:"expiry-time" xml:"expiry-time"`
}

SetRequestBody is the type of the "secret" service "set" endpoint HTTP request body.

func NewSetRequestBody

func NewSetRequestBody(p *secret.SetPayload) *SetRequestBody

NewSetRequestBody builds the HTTP request body from the payload of the "set" endpoint of the "secret" service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL