logging

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package logging provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT.

Index

Constants

View Source
const (
	HTTPBearerScopes = "HTTPBearer.Scopes"
)

Variables

This section is empty.

Functions

func NewCreateLoggerRequest

func NewCreateLoggerRequest(server string, body CreateLoggerJSONRequestBody) (*http.Request, error)

NewCreateLoggerRequest calls the generic CreateLogger builder with application/json body

func NewCreateLoggerRequestWithBody

func NewCreateLoggerRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewCreateLoggerRequestWithBody generates requests for CreateLogger with any type of body

func NewDeleteLoggerRequest

func NewDeleteLoggerRequest(server string, id openapi_types.UUID) (*http.Request, error)

NewDeleteLoggerRequest generates requests for DeleteLogger

func NewGetLoggerRequest

func NewGetLoggerRequest(server string, id openapi_types.UUID) (*http.Request, error)

NewGetLoggerRequest generates requests for GetLogger

func NewListLoggersRequest

func NewListLoggersRequest(server string, params *ListLoggersParams) (*http.Request, error)

NewListLoggersRequest generates requests for ListLoggers

func NewUpdateLoggerRequest

func NewUpdateLoggerRequest(server string, id openapi_types.UUID, body UpdateLoggerJSONRequestBody) (*http.Request, error)

NewUpdateLoggerRequest calls the generic UpdateLogger builder with application/json body

func NewUpdateLoggerRequestWithBody

func NewUpdateLoggerRequestWithBody(server string, id openapi_types.UUID, contentType string, body io.Reader) (*http.Request, error)

NewUpdateLoggerRequestWithBody generates requests for UpdateLogger with any type of body

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CreateLogger

func (c *Client) CreateLogger(ctx context.Context, body CreateLoggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateLoggerWithBody

func (c *Client) CreateLoggerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteLogger

func (c *Client) DeleteLogger(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetLogger

func (c *Client) GetLogger(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListLoggers

func (c *Client) ListLoggers(ctx context.Context, params *ListLoggersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateLogger

func (c *Client) UpdateLogger(ctx context.Context, id openapi_types.UUID, body UpdateLoggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateLoggerWithBody

func (c *Client) UpdateLoggerWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// ListLoggers request
	ListLoggers(ctx context.Context, params *ListLoggersParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateLoggerWithBody request with any body
	CreateLoggerWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateLogger(ctx context.Context, body CreateLoggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteLogger request
	DeleteLogger(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLogger request
	GetLogger(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateLoggerWithBody request with any body
	UpdateLoggerWithBody(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateLogger(ctx context.Context, id openapi_types.UUID, body UpdateLoggerJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateLoggerWithBodyWithResponse

func (c *ClientWithResponses) CreateLoggerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateLoggerResponse, error)

CreateLoggerWithBodyWithResponse request with arbitrary body returning *CreateLoggerResponse

func (*ClientWithResponses) CreateLoggerWithResponse

func (c *ClientWithResponses) CreateLoggerWithResponse(ctx context.Context, body CreateLoggerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateLoggerResponse, error)

func (*ClientWithResponses) DeleteLoggerWithResponse

func (c *ClientWithResponses) DeleteLoggerWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteLoggerResponse, error)

DeleteLoggerWithResponse request returning *DeleteLoggerResponse

func (*ClientWithResponses) GetLoggerWithResponse

func (c *ClientWithResponses) GetLoggerWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetLoggerResponse, error)

GetLoggerWithResponse request returning *GetLoggerResponse

func (*ClientWithResponses) ListLoggersWithResponse

func (c *ClientWithResponses) ListLoggersWithResponse(ctx context.Context, params *ListLoggersParams, reqEditors ...RequestEditorFn) (*ListLoggersResponse, error)

ListLoggersWithResponse request returning *ListLoggersResponse

func (*ClientWithResponses) UpdateLoggerWithBodyWithResponse

func (c *ClientWithResponses) UpdateLoggerWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateLoggerResponse, error)

UpdateLoggerWithBodyWithResponse request with arbitrary body returning *UpdateLoggerResponse

func (*ClientWithResponses) UpdateLoggerWithResponse

func (c *ClientWithResponses) UpdateLoggerWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateLoggerJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateLoggerResponse, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ListLoggersWithResponse request
	ListLoggersWithResponse(ctx context.Context, params *ListLoggersParams, reqEditors ...RequestEditorFn) (*ListLoggersResponse, error)

	// CreateLoggerWithBodyWithResponse request with any body
	CreateLoggerWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateLoggerResponse, error)

	CreateLoggerWithResponse(ctx context.Context, body CreateLoggerJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateLoggerResponse, error)

	// DeleteLoggerWithResponse request
	DeleteLoggerWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*DeleteLoggerResponse, error)

	// GetLoggerWithResponse request
	GetLoggerWithResponse(ctx context.Context, id openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetLoggerResponse, error)

	// UpdateLoggerWithBodyWithResponse request with any body
	UpdateLoggerWithBodyWithResponse(ctx context.Context, id openapi_types.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateLoggerResponse, error)

	UpdateLoggerWithResponse(ctx context.Context, id openapi_types.UUID, body UpdateLoggerJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateLoggerResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateLoggerJSONRequestBody

type CreateLoggerJSONRequestBody = ResponseLogger

CreateLoggerJSONRequestBody defines body for CreateLogger for application/json ContentType.

type CreateLoggerResponse

type CreateLoggerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *LoggerResponse
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON404      *ErrorResponse
	JSON422      *HTTPValidationError
	JSON429      *ErrorResponse
}

func ParseCreateLoggerResponse

func ParseCreateLoggerResponse(rsp *http.Response) (*CreateLoggerResponse, error)

ParseCreateLoggerResponse parses an HTTP response from a CreateLoggerWithResponse call

func (CreateLoggerResponse) Status

func (r CreateLoggerResponse) Status() string

Status returns HTTPResponse.Status

func (CreateLoggerResponse) StatusCode

func (r CreateLoggerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteLoggerResponse

type DeleteLoggerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON404      *ErrorResponse
	JSON422      *HTTPValidationError
	JSON429      *ErrorResponse
}

func ParseDeleteLoggerResponse

func ParseDeleteLoggerResponse(rsp *http.Response) (*DeleteLoggerResponse, error)

ParseDeleteLoggerResponse parses an HTTP response from a DeleteLoggerWithResponse call

func (DeleteLoggerResponse) Status

func (r DeleteLoggerResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteLoggerResponse) StatusCode

func (r DeleteLoggerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Error

type Error struct {
	Detail *string                 `json:"detail,omitempty"`
	Source *map[string]interface{} `json:"source,omitempty"`
	Status string                  `json:"status"`
	Title  string                  `json:"title"`
}

Error Single JSON:API error object.

type ErrorResponse

type ErrorResponse struct {
	Errors []Error `json:"errors"`
}

ErrorResponse JSON:API error response envelope.

type GetLoggerResponse

type GetLoggerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *LoggerResponse
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON404      *ErrorResponse
	JSON422      *HTTPValidationError
	JSON429      *ErrorResponse
}

func ParseGetLoggerResponse

func ParseGetLoggerResponse(rsp *http.Response) (*GetLoggerResponse, error)

ParseGetLoggerResponse parses an HTTP response from a GetLoggerWithResponse call

func (GetLoggerResponse) Status

func (r GetLoggerResponse) Status() string

Status returns HTTPResponse.Status

func (GetLoggerResponse) StatusCode

func (r GetLoggerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HTTPValidationError

type HTTPValidationError struct {
	Detail *[]ValidationError `json:"detail,omitempty"`
}

HTTPValidationError defines model for HTTPValidationError.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ListLoggersParams

type ListLoggersParams struct {
	FilterKey *string `form:"filter[key],omitempty" json:"filter[key],omitempty"`
}

ListLoggersParams defines parameters for ListLoggers.

type ListLoggersResponse

type ListLoggersResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *LoggerListResponse
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON404      *ErrorResponse
	JSON422      *HTTPValidationError
	JSON429      *ErrorResponse
}

func ParseListLoggersResponse

func ParseListLoggersResponse(rsp *http.Response) (*ListLoggersResponse, error)

ParseListLoggersResponse parses an HTTP response from a ListLoggersWithResponse call

func (ListLoggersResponse) Status

func (r ListLoggersResponse) Status() string

Status returns HTTPResponse.Status

func (ListLoggersResponse) StatusCode

func (r ListLoggersResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Logger

type Logger struct {
	Aliases      *[]string               `json:"aliases,omitempty"`
	CreatedAt    *time.Time              `json:"created_at,omitempty"`
	Default      string                  `json:"default"`
	Description  *string                 `json:"description,omitempty"`
	Environments *map[string]interface{} `json:"environments,omitempty"`
	Key          *string                 `json:"key,omitempty"`
	Name         string                  `json:"name"`
	UpdatedAt    *time.Time              `json:"updated_at,omitempty"`
}

Logger defines model for Logger.

type LoggerListResponse

type LoggerListResponse struct {
	Data []LoggerResource `json:"data"`
}

LoggerListResponse defines model for LoggerListResponse.

type LoggerResource

type LoggerResource struct {
	Attributes Logger  `json:"attributes"`
	Id         *string `json:"id,omitempty"`
	Type       string  `json:"type"`
}

LoggerResource defines model for LoggerResource.

type LoggerResponse

type LoggerResponse struct {
	Data LoggerResource `json:"data"`
}

LoggerResponse defines model for LoggerResponse.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type ResourceLogger

type ResourceLogger struct {
	Attributes Logger  `json:"attributes"`
	Id         *string `json:"id,omitempty"`
	Type       *string `json:"type,omitempty"`
}

ResourceLogger defines model for Resource_Logger_.

type ResponseLogger

type ResponseLogger struct {
	Data ResourceLogger `json:"data"`
}

ResponseLogger defines model for Response_Logger_.

type UpdateLoggerJSONRequestBody

type UpdateLoggerJSONRequestBody = ResponseLogger

UpdateLoggerJSONRequestBody defines body for UpdateLogger for application/json ContentType.

type UpdateLoggerResponse

type UpdateLoggerResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *LoggerResponse
	JSON400      *ErrorResponse
	JSON401      *ErrorResponse
	JSON404      *ErrorResponse
	JSON422      *HTTPValidationError
	JSON429      *ErrorResponse
}

func ParseUpdateLoggerResponse

func ParseUpdateLoggerResponse(rsp *http.Response) (*UpdateLoggerResponse, error)

ParseUpdateLoggerResponse parses an HTTP response from a UpdateLoggerWithResponse call

func (UpdateLoggerResponse) Status

func (r UpdateLoggerResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateLoggerResponse) StatusCode

func (r UpdateLoggerResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ValidationError

type ValidationError struct {
	Loc  []ValidationError_Loc_Item `json:"loc"`
	Msg  string                     `json:"msg"`
	Type string                     `json:"type"`
}

ValidationError defines model for ValidationError.

type ValidationErrorLoc0

type ValidationErrorLoc0 = string

ValidationErrorLoc0 defines model for .

type ValidationErrorLoc1

type ValidationErrorLoc1 = int

ValidationErrorLoc1 defines model for .

type ValidationError_Loc_Item

type ValidationError_Loc_Item struct {
	// contains filtered or unexported fields
}

ValidationError_Loc_Item defines model for ValidationError.loc.Item.

func (ValidationError_Loc_Item) AsValidationErrorLoc0

func (t ValidationError_Loc_Item) AsValidationErrorLoc0() (ValidationErrorLoc0, error)

AsValidationErrorLoc0 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc0

func (ValidationError_Loc_Item) AsValidationErrorLoc1

func (t ValidationError_Loc_Item) AsValidationErrorLoc1() (ValidationErrorLoc1, error)

AsValidationErrorLoc1 returns the union data inside the ValidationError_Loc_Item as a ValidationErrorLoc1

func (*ValidationError_Loc_Item) FromValidationErrorLoc0

func (t *ValidationError_Loc_Item) FromValidationErrorLoc0(v ValidationErrorLoc0) error

FromValidationErrorLoc0 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc0

func (*ValidationError_Loc_Item) FromValidationErrorLoc1

func (t *ValidationError_Loc_Item) FromValidationErrorLoc1(v ValidationErrorLoc1) error

FromValidationErrorLoc1 overwrites any union data inside the ValidationError_Loc_Item as the provided ValidationErrorLoc1

func (ValidationError_Loc_Item) MarshalJSON

func (t ValidationError_Loc_Item) MarshalJSON() ([]byte, error)

func (*ValidationError_Loc_Item) MergeValidationErrorLoc0

func (t *ValidationError_Loc_Item) MergeValidationErrorLoc0(v ValidationErrorLoc0) error

MergeValidationErrorLoc0 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc0

func (*ValidationError_Loc_Item) MergeValidationErrorLoc1

func (t *ValidationError_Loc_Item) MergeValidationErrorLoc1(v ValidationErrorLoc1) error

MergeValidationErrorLoc1 performs a merge with any union data inside the ValidationError_Loc_Item, using the provided ValidationErrorLoc1

func (*ValidationError_Loc_Item) UnmarshalJSON

func (t *ValidationError_Loc_Item) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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