api

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

Index

Constants

View Source
const (
	Api_keyScopes     = "api_key.Scopes"
	BearerAuthScopes  = "bearerAuth.Scopes"
	Bearer_authScopes = "bearer_auth.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func NewCreateTeamRequest

func NewCreateTeamRequest(server string, body CreateTeamJSONRequestBody) (*http.Request, error)

NewCreateTeamRequest calls the generic CreateTeam builder with application/json body

func NewCreateTeamRequestWithBody

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

NewCreateTeamRequestWithBody generates requests for CreateTeam with any type of body

func NewGetTeamTeamIdRequest

func NewGetTeamTeamIdRequest(server string, teamId openapi_types.UUID) (*http.Request, error)

NewGetTeamTeamIdRequest generates requests for GetTeamTeamId

func NewListSystemsRequest

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

NewListSystemsRequest generates requests for ListSystems

func NewListTeamRequest

func NewListTeamRequest(server string, params *ListTeamParams) (*http.Request, error)

NewListTeamRequest generates requests for ListTeam

func NewShowSystemRequest

func NewShowSystemRequest(server string, systemId string) (*http.Request, error)

NewShowSystemRequest generates requests for ShowSystem

func NewVersionRequest

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

NewVersionRequest generates requests for Version

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router fiber.Router, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router fiber.Router, si ServerInterface, options FiberServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

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

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

func (*Client) CreateTeamWithBody

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

func (*Client) GetTeamTeamId

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

func (*Client) ListSystems

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

func (*Client) ListTeam

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

func (*Client) ShowSystem

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

func (*Client) Version

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

type ClientInterface

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

	// ShowSystem request
	ShowSystem(ctx context.Context, systemId string, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	// ListTeam request
	ListTeam(ctx context.Context, params *ListTeamParams, reqEditors ...RequestEditorFn) (*http.Response, error)

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

	CreateTeam(ctx context.Context, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// Version request
	Version(ctx context.Context, 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) CreateTeamWithBodyWithResponse

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

CreateTeamWithBodyWithResponse request with arbitrary body returning *CreateTeamResponse

func (*ClientWithResponses) CreateTeamWithResponse

func (c *ClientWithResponses) CreateTeamWithResponse(ctx context.Context, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error)

func (*ClientWithResponses) GetTeamTeamIdWithResponse

func (c *ClientWithResponses) GetTeamTeamIdWithResponse(ctx context.Context, teamId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTeamTeamIdResponse, error)

GetTeamTeamIdWithResponse request returning *GetTeamTeamIdResponse

func (*ClientWithResponses) ListSystemsWithResponse

func (c *ClientWithResponses) ListSystemsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSystemsResponse, error)

ListSystemsWithResponse request returning *ListSystemsResponse

func (*ClientWithResponses) ListTeamWithResponse

func (c *ClientWithResponses) ListTeamWithResponse(ctx context.Context, params *ListTeamParams, reqEditors ...RequestEditorFn) (*ListTeamResponse, error)

ListTeamWithResponse request returning *ListTeamResponse

func (*ClientWithResponses) ShowSystemWithResponse

func (c *ClientWithResponses) ShowSystemWithResponse(ctx context.Context, systemId string, reqEditors ...RequestEditorFn) (*ShowSystemResponse, error)

ShowSystemWithResponse request returning *ShowSystemResponse

func (*ClientWithResponses) VersionWithResponse

func (c *ClientWithResponses) VersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*VersionResponse, error)

VersionWithResponse request returning *VersionResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ListSystemsWithResponse request
	ListSystemsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListSystemsResponse, error)

	// ShowSystemWithResponse request
	ShowSystemWithResponse(ctx context.Context, systemId string, reqEditors ...RequestEditorFn) (*ShowSystemResponse, error)

	// GetTeamTeamIdWithResponse request
	GetTeamTeamIdWithResponse(ctx context.Context, teamId openapi_types.UUID, reqEditors ...RequestEditorFn) (*GetTeamTeamIdResponse, error)

	// ListTeamWithResponse request
	ListTeamWithResponse(ctx context.Context, params *ListTeamParams, reqEditors ...RequestEditorFn) (*ListTeamResponse, error)

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

	CreateTeamWithResponse(ctx context.Context, body CreateTeamJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTeamResponse, error)

	// VersionWithResponse request
	VersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*VersionResponse, error)
}

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

type CreateTeam

type CreateTeam = Team

CreateTeam defines model for CreateTeam.

type CreateTeam201JSONResponse

type CreateTeam201JSONResponse Team

func (CreateTeam201JSONResponse) VisitCreateTeamResponse

func (response CreateTeam201JSONResponse) VisitCreateTeamResponse(ctx *fiber.Ctx) error

type CreateTeamJSONRequestBody

type CreateTeamJSONRequestBody = Team

CreateTeamJSONRequestBody defines body for CreateTeam for application/json ContentType.

type CreateTeamRequestObject

type CreateTeamRequestObject struct {
	Body *CreateTeamJSONRequestBody
}

type CreateTeamResponse

type CreateTeamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *Team
}

func ParseCreateTeamResponse

func ParseCreateTeamResponse(rsp *http.Response) (*CreateTeamResponse, error)

ParseCreateTeamResponse parses an HTTP response from a CreateTeamWithResponse call

func (CreateTeamResponse) Status

func (r CreateTeamResponse) Status() string

Status returns HTTPResponse.Status

func (CreateTeamResponse) StatusCode

func (r CreateTeamResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type CreateTeamResponseObject

type CreateTeamResponseObject interface {
	VisitCreateTeamResponse(ctx *fiber.Ctx) error
}

type FiberServerOptions

type FiberServerOptions struct {
	BaseURL     string
	Middlewares []MiddlewareFunc
}

FiberServerOptions provides options for the Fiber server.

type GetTeamTeamId200JSONResponse

type GetTeamTeamId200JSONResponse Team

func (GetTeamTeamId200JSONResponse) VisitGetTeamTeamIdResponse

func (response GetTeamTeamId200JSONResponse) VisitGetTeamTeamIdResponse(ctx *fiber.Ctx) error

type GetTeamTeamIdRequestObject

type GetTeamTeamIdRequestObject struct {
	TeamId openapi_types.UUID `json:"teamId"`
}

type GetTeamTeamIdResponse

type GetTeamTeamIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Team
}

func ParseGetTeamTeamIdResponse

func ParseGetTeamTeamIdResponse(rsp *http.Response) (*GetTeamTeamIdResponse, error)

ParseGetTeamTeamIdResponse parses an HTTP response from a GetTeamTeamIdWithResponse call

func (GetTeamTeamIdResponse) Status

func (r GetTeamTeamIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetTeamTeamIdResponse) StatusCode

func (r GetTeamTeamIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetTeamTeamIdResponseObject

type GetTeamTeamIdResponseObject interface {
	VisitGetTeamTeamIdResponse(ctx *fiber.Ctx) error
}

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type LimitParam

type LimitParam = int

LimitParam defines model for limitParam.

type ListSystems200JSONResponse

type ListSystems200JSONResponse Systems

func (ListSystems200JSONResponse) VisitListSystemsResponse

func (response ListSystems200JSONResponse) VisitListSystemsResponse(ctx *fiber.Ctx) error

type ListSystemsRequestObject

type ListSystemsRequestObject struct {
}

type ListSystemsResponse

type ListSystemsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Systems
}

func ParseListSystemsResponse

func ParseListSystemsResponse(rsp *http.Response) (*ListSystemsResponse, error)

ParseListSystemsResponse parses an HTTP response from a ListSystemsWithResponse call

func (ListSystemsResponse) Status

func (r ListSystemsResponse) Status() string

Status returns HTTPResponse.Status

func (ListSystemsResponse) StatusCode

func (r ListSystemsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListSystemsResponseObject

type ListSystemsResponseObject interface {
	VisitListSystemsResponse(ctx *fiber.Ctx) error
}

type ListTeam200JSONResponse

type ListTeam200JSONResponse struct {
	Limit   *float32 `json:"limit,omitempty"`
	Offset  *float32 `json:"offset,omitempty"`
	Results *[]Team  `json:"results,omitempty"`
	Total   *float32 `json:"total,omitempty"`
}

func (ListTeam200JSONResponse) VisitListTeamResponse

func (response ListTeam200JSONResponse) VisitListTeamResponse(ctx *fiber.Ctx) error

type ListTeamParams

type ListTeamParams struct {
	// Offset The number of items to skip before starting to collect the result set.
	Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`

	// Limit The numbers of items to return.
	Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}

ListTeamParams defines parameters for ListTeam.

type ListTeamRequestObject

type ListTeamRequestObject struct {
	Params ListTeamParams
}

type ListTeamResponse

type ListTeamResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *struct {
		Limit   *float32 `json:"limit,omitempty"`
		Offset  *float32 `json:"offset,omitempty"`
		Results *[]Team  `json:"results,omitempty"`
		Total   *float32 `json:"total,omitempty"`
	}
}

func ParseListTeamResponse

func ParseListTeamResponse(rsp *http.Response) (*ListTeamResponse, error)

ParseListTeamResponse parses an HTTP response from a ListTeamWithResponse call

func (ListTeamResponse) Status

func (r ListTeamResponse) Status() string

Status returns HTTPResponse.Status

func (ListTeamResponse) StatusCode

func (r ListTeamResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListTeamResponseObject

type ListTeamResponseObject interface {
	VisitListTeamResponse(ctx *fiber.Ctx) error
}

type MiddlewareFunc

type MiddlewareFunc fiber.Handler

type OffsetParam

type OffsetParam = int

OffsetParam defines model for offsetParam.

type PaginatedResult

type PaginatedResult struct {
	Limit   *float32       `json:"limit,omitempty"`
	Offset  *float32       `json:"offset,omitempty"`
	Results *[]interface{} `json:"results,omitempty"`
	Total   *float32       `json:"total,omitempty"`
}

PaginatedResult defines model for PaginatedResult.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type ServerInterface

type ServerInterface interface {
	// List all managed systems.
	// (GET /systems)
	ListSystems(c *fiber.Ctx) error
	// List all managed systems.
	// (GET /systems/{systemId})
	ShowSystem(c *fiber.Ctx, systemId string) error
	// Gets a team by ID
	// (GET /team/{teamId})
	GetTeamTeamId(c *fiber.Ctx, teamId openapi_types.UUID) error
	// List all teams
	// (GET /teams)
	ListTeam(c *fiber.Ctx, params ListTeamParams) error
	// Creates a new team
	// (POST /teams)
	CreateTeam(c *fiber.Ctx) error
	// Returns the current version of the API.
	// (GET /version)
	Version(c *fiber.Ctx) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) CreateTeam

func (siw *ServerInterfaceWrapper) CreateTeam(c *fiber.Ctx) error

CreateTeam operation middleware

func (*ServerInterfaceWrapper) GetTeamTeamId

func (siw *ServerInterfaceWrapper) GetTeamTeamId(c *fiber.Ctx) error

GetTeamTeamId operation middleware

func (*ServerInterfaceWrapper) ListSystems

func (siw *ServerInterfaceWrapper) ListSystems(c *fiber.Ctx) error

ListSystems operation middleware

func (*ServerInterfaceWrapper) ListTeam

func (siw *ServerInterfaceWrapper) ListTeam(c *fiber.Ctx) error

ListTeam operation middleware

func (*ServerInterfaceWrapper) ShowSystem

func (siw *ServerInterfaceWrapper) ShowSystem(c *fiber.Ctx) error

ShowSystem operation middleware

func (*ServerInterfaceWrapper) Version

func (siw *ServerInterfaceWrapper) Version(c *fiber.Ctx) error

Version operation middleware

type ShowSystem200Response

type ShowSystem200Response struct {
}

func (ShowSystem200Response) VisitShowSystemResponse

func (response ShowSystem200Response) VisitShowSystemResponse(ctx *fiber.Ctx) error

type ShowSystemRequestObject

type ShowSystemRequestObject struct {
	SystemId string `json:"systemId"`
}

type ShowSystemResponse

type ShowSystemResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseShowSystemResponse

func ParseShowSystemResponse(rsp *http.Response) (*ShowSystemResponse, error)

ParseShowSystemResponse parses an HTTP response from a ShowSystemWithResponse call

func (ShowSystemResponse) Status

func (r ShowSystemResponse) Status() string

Status returns HTTPResponse.Status

func (ShowSystemResponse) StatusCode

func (r ShowSystemResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ShowSystemResponseObject

type ShowSystemResponseObject interface {
	VisitShowSystemResponse(ctx *fiber.Ctx) error
}

type StrictHandlerFunc

type StrictHandlerFunc func(ctx *fiber.Ctx, args interface{}) (interface{}, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// List all managed systems.
	// (GET /systems)
	ListSystems(ctx context.Context, request ListSystemsRequestObject) (ListSystemsResponseObject, error)
	// List all managed systems.
	// (GET /systems/{systemId})
	ShowSystem(ctx context.Context, request ShowSystemRequestObject) (ShowSystemResponseObject, error)
	// Gets a team by ID
	// (GET /team/{teamId})
	GetTeamTeamId(ctx context.Context, request GetTeamTeamIdRequestObject) (GetTeamTeamIdResponseObject, error)
	// List all teams
	// (GET /teams)
	ListTeam(ctx context.Context, request ListTeamRequestObject) (ListTeamResponseObject, error)
	// Creates a new team
	// (POST /teams)
	CreateTeam(ctx context.Context, request CreateTeamRequestObject) (CreateTeamResponseObject, error)
	// Returns the current version of the API.
	// (GET /version)
	Version(ctx context.Context, request VersionRequestObject) (VersionResponseObject, error)
}

StrictServerInterface represents all server handlers.

type System

type System struct {
	// CreatedAt Creation date and time
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// DeletedAt Creation date and time
	DeletedAt *time.Time `json:"deletedAt,omitempty"`

	// Description A description of the system.
	Description *string             `json:"description,omitempty"`
	Id          *openapi_types.UUID `gorm:"type:uuid;default:gen_random_uuid()" json:"id,omitempty"`

	// Name Name of the system
	Name string `json:"name"`

	// UpdatedAt Creation date and time
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}

System defines model for System.

type Systems

type Systems = []System

Systems defines model for Systems.

type Team

type Team struct {
	ContactEmail *string `json:"contactEmail,omitempty"`

	// CreatedAt Creation date and time
	CreatedAt *time.Time `json:"createdAt,omitempty"`

	// DeletedAt Creation date and time
	DeletedAt   *time.Time          `json:"deletedAt,omitempty"`
	Description *string             `json:"description,omitempty"`
	Id          *openapi_types.UUID `gorm:"type:uuid;default:gen_random_uuid()" json:"id,omitempty"`
	Name        string              `json:"name"`

	// UpdatedAt Creation date and time
	UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}

Team defines model for Team.

type Version

type Version struct {
	Date    string `json:"date"`
	Version string `json:"version"`
}

Version defines model for Version.

type Version200JSONResponse

type Version200JSONResponse Version

func (Version200JSONResponse) VisitVersionResponse

func (response Version200JSONResponse) VisitVersionResponse(ctx *fiber.Ctx) error

type VersionRequestObject

type VersionRequestObject struct {
}

type VersionResponse

type VersionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *Version
}

func ParseVersionResponse

func ParseVersionResponse(rsp *http.Response) (*VersionResponse, error)

ParseVersionResponse parses an HTTP response from a VersionWithResponse call

func (VersionResponse) Status

func (r VersionResponse) Status() string

Status returns HTTPResponse.Status

func (VersionResponse) StatusCode

func (r VersionResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type VersionResponseObject

type VersionResponseObject interface {
	VisitVersionResponse(ctx *fiber.Ctx) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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