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
- func GetSwagger() (swagger *openapi3.T, err error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router gin.IRouter, si ServerInterface)
- func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions)
- type APIError
- type BuildID
- type CPUCount
- type EnvVars
- type Error
- type GetSandboxesSandboxIDLogsParams
- type GetTemplatesParams
- type GetTemplatesTemplateIDBuildsBuildIDStatusParams
- type GinServerOptions
- type MemoryMB
- type MiddlewareFunc
- type N400
- type N401
- type N404
- type N500
- type NewSandbox
- type PatchTemplatesTemplateIDJSONRequestBody
- type PostSandboxesJSONRequestBody
- type PostSandboxesSandboxIDRefreshesJSONBody
- type PostSandboxesSandboxIDRefreshesJSONRequestBody
- type PostSandboxesSandboxIDTimeoutJSONBody
- type PostSandboxesSandboxIDTimeoutJSONRequestBody
- type PostTemplatesJSONRequestBody
- type PostTemplatesTemplateIDJSONRequestBody
- type RunningSandbox
- type Sandbox
- type SandboxID
- type SandboxLog
- type SandboxLogs
- type SandboxMetadata
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) DeleteSandboxesSandboxID(c *gin.Context)
- func (siw *ServerInterfaceWrapper) DeleteTemplatesTemplateID(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetHealth(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetSandboxes(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetSandboxesSandboxIDLogs(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTeams(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTemplates(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTemplatesTemplateIDBuildsBuildIDStatus(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PatchTemplatesTemplateID(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostSandboxes(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostSandboxesSandboxIDRefreshes(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostSandboxesSandboxIDTimeout(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostTemplates(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostTemplatesTemplateID(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostTemplatesTemplateIDBuildsBuildID(c *gin.Context)
- type Team
- type TeamUser
- type Template
- type TemplateBuild
- type TemplateBuildRequest
- type TemplateBuildStatus
- type TemplateID
- type TemplateUpdateRequest
Constants ¶
const ( AccessTokenAuthScopes = "AccessTokenAuth.Scopes" ApiKeyAuthScopes = "ApiKeyAuth.Scopes" )
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
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 ¶
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 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 MiddlewareFunc ¶
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 PatchTemplatesTemplateIDJSONRequestBody ¶
type PatchTemplatesTemplateIDJSONRequestBody = TemplateUpdateRequest
PatchTemplatesTemplateIDJSONRequestBody defines body for PatchTemplatesTemplateID for application/json ContentType.
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 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 ¶
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) // (PATCH /templates/{templateID}) PatchTemplatesTemplateID(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) PatchTemplatesTemplateID ¶
func (siw *ServerInterfaceWrapper) PatchTemplatesTemplateID(c *gin.Context)
PatchTemplatesTemplateID 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 TeamUser ¶
type TeamUser struct { // Email Email of the user Email string `json:"email"` // Id Identifier of the user Id openapi_types.UUID `json:"id"` }
TeamUser defines model for TeamUser.
type Template ¶
type Template struct { // Aliases Aliases of the template Aliases *[]string `json:"aliases,omitempty"` // BuildCount Number of times the template was built BuildCount int32 `json:"buildCount"` // BuildID Identifier of the last successful build for given template BuildID string `json:"buildID"` // CpuCount CPU cores for the sandbox CpuCount CPUCount `json:"cpuCount"` // CreatedAt Time when the template was created CreatedAt time.Time `json:"createdAt"` CreatedBy *TeamUser `json:"createdBy"` // LastSpawnedAt Time when the template was last used LastSpawnedAt time.Time `json:"lastSpawnedAt"` // 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"` // SpawnCount Number of times the template was used SpawnCount int64 `json:"spawnCount"` // TemplateID Identifier of the template TemplateID string `json:"templateID"` // UpdatedAt Time when the template was last updated UpdatedAt time.Time `json:"updatedAt"` }
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 TemplateUpdateRequest ¶
type TemplateUpdateRequest struct { // Public Whether the template is public or only accessible by the team Public *bool `json:"public,omitempty"` }
TemplateUpdateRequest defines model for TemplateUpdateRequest.