api

package
v0.0.0-...-8fe0098 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

Index

Constants

View Source
const (
	AccessTokenAuthScopes = "AccessTokenAuth.Scopes"
	ApiKeyAuthScopes      = "ApiKeyAuth.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 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 gin.IRouter, si ServerInterface)

RegisterHandlers creates http.Handler with routing matching OpenAPI spec.

func RegisterHandlersWithOptions

func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)

RegisterHandlersWithOptions creates http.Handler with additional options

Types

type APIError

type APIError struct {
	Err       error
	ClientMsg string
	Code      int
}

type BuildID

type BuildID = string

BuildID defines model for buildID.

type CPUCount

type CPUCount = int32

CPUCount CPU cores for the sandbox

type EnvVars

type EnvVars map[string]string

EnvVars defines model for EnvVars.

type Error

type Error struct {
	// Code Error code
	Code int32 `json:"code"`

	// Message Error
	Message string `json:"message"`
}

Error defines model for Error.

type GetSandboxesSandboxIDLogsParams

type GetSandboxesSandboxIDLogsParams struct {
	// Start Starting timestamp of the logs that should be returned in milliseconds
	Start *int64 `form:"start,omitempty" json:"start,omitempty"`

	// Limit Maximum number of logs that should be returned
	Limit *int32 `form:"limit,omitempty" json:"limit,omitempty"`
}

GetSandboxesSandboxIDLogsParams defines parameters for GetSandboxesSandboxIDLogs.

type GetTemplatesParams

type GetTemplatesParams struct {
	TeamID *string `form:"teamID,omitempty" json:"teamID,omitempty"`
}

GetTemplatesParams defines parameters for GetTemplates.

type GetTemplatesTemplateIDBuildsBuildIDStatusParams

type GetTemplatesTemplateIDBuildsBuildIDStatusParams struct {
	// LogsOffset Index of the starting build log that should be returned with the template
	LogsOffset *int32 `form:"logsOffset,omitempty" json:"logsOffset,omitempty"`
}

GetTemplatesTemplateIDBuildsBuildIDStatusParams defines parameters for GetTemplatesTemplateIDBuildsBuildIDStatus.

type GinServerOptions

type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

GinServerOptions provides options for the Gin server.

type MemoryMB

type MemoryMB = int32

MemoryMB Memory for the sandbox in MB

type MiddlewareFunc

type MiddlewareFunc func(c *gin.Context)

type N400

type N400 = Error

N400 defines model for 400.

type N401

type N401 = Error

N401 defines model for 401.

type N404

type N404 = Error

N404 defines model for 404.

type N500

type N500 = Error

N500 defines model for 500.

type NewSandbox

type NewSandbox struct {
	EnvVars  *EnvVars         `json:"envVars,omitempty"`
	Metadata *SandboxMetadata `json:"metadata,omitempty"`

	// TemplateID Identifier of the required template
	TemplateID string `json:"templateID"`

	// Timeout Time to live for the sandbox in seconds.
	Timeout *int32 `json:"timeout,omitempty"`
}

NewSandbox defines model for NewSandbox.

type PostSandboxesJSONRequestBody

type PostSandboxesJSONRequestBody = NewSandbox

PostSandboxesJSONRequestBody defines body for PostSandboxes for application/json ContentType.

type PostSandboxesSandboxIDRefreshesJSONBody

type PostSandboxesSandboxIDRefreshesJSONBody struct {
	// Duration Duration for which the sandbox should be kept alive in seconds
	Duration *int `json:"duration,omitempty"`
}

PostSandboxesSandboxIDRefreshesJSONBody defines parameters for PostSandboxesSandboxIDRefreshes.

type PostSandboxesSandboxIDRefreshesJSONRequestBody

type PostSandboxesSandboxIDRefreshesJSONRequestBody PostSandboxesSandboxIDRefreshesJSONBody

PostSandboxesSandboxIDRefreshesJSONRequestBody defines body for PostSandboxesSandboxIDRefreshes for application/json ContentType.

type PostSandboxesSandboxIDTimeoutJSONBody

type PostSandboxesSandboxIDTimeoutJSONBody struct {
	// Timeout Timeout in seconds from the current time after which the sandbox should expire
	Timeout int32 `json:"timeout"`
}

PostSandboxesSandboxIDTimeoutJSONBody defines parameters for PostSandboxesSandboxIDTimeout.

type PostSandboxesSandboxIDTimeoutJSONRequestBody

type PostSandboxesSandboxIDTimeoutJSONRequestBody PostSandboxesSandboxIDTimeoutJSONBody

PostSandboxesSandboxIDTimeoutJSONRequestBody defines body for PostSandboxesSandboxIDTimeout for application/json ContentType.

type PostTemplatesJSONRequestBody

type PostTemplatesJSONRequestBody = TemplateBuildRequest

PostTemplatesJSONRequestBody defines body for PostTemplates for application/json ContentType.

type PostTemplatesTemplateIDJSONRequestBody

type PostTemplatesTemplateIDJSONRequestBody = TemplateBuildRequest

PostTemplatesTemplateIDJSONRequestBody defines body for PostTemplatesTemplateID for application/json ContentType.

type RunningSandbox

type RunningSandbox struct {
	// Alias Alias of the template
	Alias *string `json:"alias,omitempty"`

	// ClientID Identifier of the client
	ClientID string `json:"clientID"`

	// CpuCount CPU cores for the sandbox
	CpuCount CPUCount `json:"cpuCount"`

	// EndAt Time when the sandbox will expire
	EndAt time.Time `json:"endAt"`

	// MemoryMB Memory for the sandbox in MB
	MemoryMB MemoryMB         `json:"memoryMB"`
	Metadata *SandboxMetadata `json:"metadata,omitempty"`

	// SandboxID Identifier of the sandbox
	SandboxID string `json:"sandboxID"`

	// StartedAt Time when the sandbox was started
	StartedAt time.Time `json:"startedAt"`

	// TemplateID Identifier of the template from which is the sandbox created
	TemplateID string `json:"templateID"`
}

RunningSandbox defines model for RunningSandbox.

type Sandbox

type Sandbox struct {
	// Alias Alias of the template
	Alias *string `json:"alias,omitempty"`

	// ClientID Identifier of the client
	ClientID string `json:"clientID"`

	// EnvdVersion Version of the envd running in the sandbox
	EnvdVersion string `json:"envdVersion"`

	// SandboxID Identifier of the sandbox
	SandboxID string `json:"sandboxID"`

	// TemplateID Identifier of the template from which is the sandbox created
	TemplateID string `json:"templateID"`
}

Sandbox defines model for Sandbox.

type SandboxID

type SandboxID = string

SandboxID defines model for sandboxID.

type SandboxLog

type SandboxLog struct {
	// Line Log line content
	Line string `json:"line"`

	// Timestamp Timestamp of the log entry
	Timestamp time.Time `json:"timestamp"`
}

SandboxLog Log entry with timestamp and line

type SandboxLogs

type SandboxLogs struct {
	// Logs Logs of the sandbox
	Logs []SandboxLog `json:"logs"`
}

SandboxLogs defines model for SandboxLogs.

type SandboxMetadata

type SandboxMetadata map[string]string

SandboxMetadata defines model for SandboxMetadata.

type ServerInterface

type ServerInterface interface {

	// (GET /health)
	GetHealth(c *gin.Context)

	// (GET /sandboxes)
	GetSandboxes(c *gin.Context)

	// (POST /sandboxes)
	PostSandboxes(c *gin.Context)

	// (DELETE /sandboxes/{sandboxID})
	DeleteSandboxesSandboxID(c *gin.Context, sandboxID SandboxID)

	// (GET /sandboxes/{sandboxID}/logs)
	GetSandboxesSandboxIDLogs(c *gin.Context, sandboxID SandboxID, params GetSandboxesSandboxIDLogsParams)

	// (POST /sandboxes/{sandboxID}/refreshes)
	PostSandboxesSandboxIDRefreshes(c *gin.Context, sandboxID SandboxID)

	// (POST /sandboxes/{sandboxID}/timeout)
	PostSandboxesSandboxIDTimeout(c *gin.Context, sandboxID SandboxID)

	// (GET /teams)
	GetTeams(c *gin.Context)

	// (GET /templates)
	GetTemplates(c *gin.Context, params GetTemplatesParams)

	// (POST /templates)
	PostTemplates(c *gin.Context)

	// (DELETE /templates/{templateID})
	DeleteTemplatesTemplateID(c *gin.Context, templateID TemplateID)

	// (POST /templates/{templateID})
	PostTemplatesTemplateID(c *gin.Context, templateID TemplateID)

	// (POST /templates/{templateID}/builds/{buildID})
	PostTemplatesTemplateIDBuildsBuildID(c *gin.Context, templateID TemplateID, buildID BuildID)

	// (GET /templates/{templateID}/builds/{buildID}/status)
	GetTemplatesTemplateIDBuildsBuildIDStatus(c *gin.Context, templateID TemplateID, buildID BuildID, params GetTemplatesTemplateIDBuildsBuildIDStatusParams)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) DeleteSandboxesSandboxID

func (siw *ServerInterfaceWrapper) DeleteSandboxesSandboxID(c *gin.Context)

DeleteSandboxesSandboxID operation middleware

func (*ServerInterfaceWrapper) DeleteTemplatesTemplateID

func (siw *ServerInterfaceWrapper) DeleteTemplatesTemplateID(c *gin.Context)

DeleteTemplatesTemplateID operation middleware

func (*ServerInterfaceWrapper) GetHealth

func (siw *ServerInterfaceWrapper) GetHealth(c *gin.Context)

GetHealth operation middleware

func (*ServerInterfaceWrapper) GetSandboxes

func (siw *ServerInterfaceWrapper) GetSandboxes(c *gin.Context)

GetSandboxes operation middleware

func (*ServerInterfaceWrapper) GetSandboxesSandboxIDLogs

func (siw *ServerInterfaceWrapper) GetSandboxesSandboxIDLogs(c *gin.Context)

GetSandboxesSandboxIDLogs operation middleware

func (*ServerInterfaceWrapper) GetTeams

func (siw *ServerInterfaceWrapper) GetTeams(c *gin.Context)

GetTeams operation middleware

func (*ServerInterfaceWrapper) GetTemplates

func (siw *ServerInterfaceWrapper) GetTemplates(c *gin.Context)

GetTemplates operation middleware

func (*ServerInterfaceWrapper) GetTemplatesTemplateIDBuildsBuildIDStatus

func (siw *ServerInterfaceWrapper) GetTemplatesTemplateIDBuildsBuildIDStatus(c *gin.Context)

GetTemplatesTemplateIDBuildsBuildIDStatus operation middleware

func (*ServerInterfaceWrapper) PostSandboxes

func (siw *ServerInterfaceWrapper) PostSandboxes(c *gin.Context)

PostSandboxes operation middleware

func (*ServerInterfaceWrapper) PostSandboxesSandboxIDRefreshes

func (siw *ServerInterfaceWrapper) PostSandboxesSandboxIDRefreshes(c *gin.Context)

PostSandboxesSandboxIDRefreshes operation middleware

func (*ServerInterfaceWrapper) PostSandboxesSandboxIDTimeout

func (siw *ServerInterfaceWrapper) PostSandboxesSandboxIDTimeout(c *gin.Context)

PostSandboxesSandboxIDTimeout operation middleware

func (*ServerInterfaceWrapper) PostTemplates

func (siw *ServerInterfaceWrapper) PostTemplates(c *gin.Context)

PostTemplates operation middleware

func (*ServerInterfaceWrapper) PostTemplatesTemplateID

func (siw *ServerInterfaceWrapper) PostTemplatesTemplateID(c *gin.Context)

PostTemplatesTemplateID operation middleware

func (*ServerInterfaceWrapper) PostTemplatesTemplateIDBuildsBuildID

func (siw *ServerInterfaceWrapper) PostTemplatesTemplateIDBuildsBuildID(c *gin.Context)

PostTemplatesTemplateIDBuildsBuildID operation middleware

type Team

type Team struct {
	// ApiKey API key for the team
	ApiKey string `json:"apiKey"`

	// IsDefault Whether the team is the default team
	IsDefault bool `json:"isDefault"`

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

	// TeamID Identifier of the team
	TeamID string `json:"teamID"`
}

Team defines model for Team.

type Template

type Template struct {
	// Aliases Aliases of the template
	Aliases *[]string `json:"aliases,omitempty"`

	// BuildID Identifier of the last successful build for given template
	BuildID string `json:"buildID"`

	// CpuCount CPU cores for the sandbox
	CpuCount CPUCount `json:"cpuCount"`

	// MemoryMB Memory for the sandbox in MB
	MemoryMB MemoryMB `json:"memoryMB"`

	// Public Whether the template is public or only accessible by the team
	Public bool `json:"public"`

	// TemplateID Identifier of the template
	TemplateID string `json:"templateID"`
}

Template defines model for Template.

type TemplateBuild

type TemplateBuild struct {
	// BuildID Identifier of the build
	BuildID string `json:"buildID"`

	// Logs Build logs
	Logs []string `json:"logs"`

	// Status Status of the template
	Status TemplateBuildStatus `json:"status"`

	// TemplateID Identifier of the template
	TemplateID string `json:"templateID"`
}

TemplateBuild defines model for TemplateBuild.

type TemplateBuildRequest

type TemplateBuildRequest struct {
	// Alias Alias of the template
	Alias *string `json:"alias,omitempty"`

	// CpuCount CPU cores for the sandbox
	CpuCount *CPUCount `json:"cpuCount,omitempty"`

	// Dockerfile Dockerfile for the template
	Dockerfile string `json:"dockerfile"`

	// MemoryMB Memory for the sandbox in MB
	MemoryMB *MemoryMB `json:"memoryMB,omitempty"`

	// StartCmd Start command to execute in the template after the build
	StartCmd *string `json:"startCmd,omitempty"`

	// TeamID Identifier of the team
	TeamID *string `json:"teamID,omitempty"`
}

TemplateBuildRequest defines model for TemplateBuildRequest.

type TemplateBuildStatus

type TemplateBuildStatus string

TemplateBuildStatus Status of the template

const (
	TemplateBuildStatusBuilding TemplateBuildStatus = "building"
	TemplateBuildStatusError    TemplateBuildStatus = "error"
	TemplateBuildStatusReady    TemplateBuildStatus = "ready"
)

Defines values for TemplateBuildStatus.

type TemplateID

type TemplateID = string

TemplateID defines model for templateID.

Jump to

Keyboard shortcuts

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