apilogapi

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

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

Code generated by github.com/deepmap/oapi-codegen version v1.12.4 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerScopes = "Bearer.Scopes"
)

Variables

This section is empty.

Functions

func NewGetLogRequest

func NewGetLogRequest(server string, apiLogId ApiLogId) (*http.Request, error)

NewGetLogRequest generates requests for GetLog

func NewGetLogsRequest

func NewGetLogsRequest(server string) (*http.Request, error)

NewGetLogsRequest generates requests for GetLogs

func NewReturnInternalServerErrorRequest

func NewReturnInternalServerErrorRequest(server string) (*http.Request, error)

NewReturnInternalServerErrorRequest generates requests for ReturnInternalServerError

Types

type ApiLog

type ApiLog struct {
	// ApiKey APIキー
	ApiKey   string `json:"api_key"`
	ApiLogId Uuid   `json:"api_log_id"`

	// CreatedAt APIログ登録日時のエポック秒
	CreatedAt int64 `json:"created_at"`

	// CreatedDate APIログ登録日
	CreatedDate string `json:"created_date"`

	// Referer リクエストリファラー
	Referer string `json:"referer"`

	// RemoteAddress クライアントIPアドレス
	RemoteAddress string `json:"remote_address"`

	// RequestBody リクエストボディー
	RequestBody string `json:"request_body"`

	// RequestMethod リクエストメソッド
	RequestMethod string `json:"request_method"`

	// RequestUri リクエストURI
	RequestUri string `json:"request_uri"`

	// ResponseBody レスポンスボディー
	ResponseBody string `json:"response_body"`

	// ResponseStatus レスポンスステータス
	ResponseStatus string `json:"response_status"`
	SaasId         Uuid   `json:"saas_id"`

	// TraceId トレースID
	TraceId string `json:"trace_id"`

	// Ttl APIログ削除予定エポック秒
	Ttl int64 `json:"ttl"`
}

ApiLog defines model for ApiLog.

type ApiLogId

type ApiLogId = Uuid

ApiLogId defines model for ApiLogId.

type ApiLogs

type ApiLogs struct {
	ApiLogs []ApiLog `json:"api_logs"`
}

ApiLogs defines model for ApiLogs.

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) GetLog

func (c *Client) GetLog(ctx context.Context, apiLogId ApiLogId, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetLogs

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

func (*Client) ReturnInternalServerError

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

type ClientInterface

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

	// GetLogs request
	GetLogs(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetLog request
	GetLog(ctx context.Context, apiLogId ApiLogId, 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) GetLogWithResponse

func (c *ClientWithResponses) GetLogWithResponse(ctx context.Context, apiLogId ApiLogId, reqEditors ...RequestEditorFn) (*GetLogResponse, error)

GetLogWithResponse request returning *GetLogResponse

func (*ClientWithResponses) GetLogsWithResponse

func (c *ClientWithResponses) GetLogsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogsResponse, error)

GetLogsWithResponse request returning *GetLogsResponse

func (*ClientWithResponses) ReturnInternalServerErrorWithResponse

func (c *ClientWithResponses) ReturnInternalServerErrorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ReturnInternalServerErrorResponse, error)

ReturnInternalServerErrorWithResponse request returning *ReturnInternalServerErrorResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ReturnInternalServerError request
	ReturnInternalServerErrorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ReturnInternalServerErrorResponse, error)

	// GetLogs request
	GetLogsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetLogsResponse, error)

	// GetLog request
	GetLogWithResponse(ctx context.Context, apiLogId ApiLogId, reqEditors ...RequestEditorFn) (*GetLogResponse, error)
}

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

type Error

type Error struct {
	// Message Error message
	Message string `json:"message"`

	// Type permission_denied
	Type string `json:"type"`
}

Error defines model for Error.

type GetLogResponse

type GetLogResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ApiLog
	JSON500      *Error
}

func ParseGetLogResponse

func ParseGetLogResponse(rsp *http.Response) (*GetLogResponse, error)

ParseGetLogResponse parses an HTTP response from a GetLogWithResponse call

func (GetLogResponse) Status

func (r GetLogResponse) Status() string

Status returns HTTPResponse.Status

func (GetLogResponse) StatusCode

func (r GetLogResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetLogsResponse

type GetLogsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ApiLogs
	JSON500      *Error
}

func ParseGetLogsResponse

func ParseGetLogsResponse(rsp *http.Response) (*GetLogsResponse, error)

ParseGetLogsResponse parses an HTTP response from a GetLogsWithResponse call

func (GetLogsResponse) Status

func (r GetLogsResponse) Status() string

Status returns HTTPResponse.Status

func (GetLogsResponse) StatusCode

func (r GetLogsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ReturnInternalServerErrorResponse

type ReturnInternalServerErrorResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON500      *Error
}

func ParseReturnInternalServerErrorResponse

func ParseReturnInternalServerErrorResponse(rsp *http.Response) (*ReturnInternalServerErrorResponse, error)

ParseReturnInternalServerErrorResponse parses an HTTP response from a ReturnInternalServerErrorWithResponse call

func (ReturnInternalServerErrorResponse) Status

Status returns HTTPResponse.Status

func (ReturnInternalServerErrorResponse) StatusCode

func (r ReturnInternalServerErrorResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Uuid

type Uuid = string

Uuid defines model for Uuid.

Jump to

Keyboard shortcuts

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