Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 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 AddTeamMemberRequest
- type BuildId
- type BuildIdOrTemplate
- type BuildIds
- type BuildInfo
- type BuildStatus
- type BuildStatusItem
- type BuildStatuses
- type BuildsCursor
- type BuildsLimit
- type BuildsListResponse
- type BuildsStatusesResponse
- type CPUCount
- type DefaultTemplate
- type DefaultTemplateAlias
- type DefaultTemplatesResponse
- type DiskSizeMB
- type Error
- type GetBuildsParams
- type GetBuildsStatusesParams
- type GetTeamsResolveParams
- type GinServerOptions
- type HealthResponse
- type ListedBuild
- type MemoryMB
- type MiddlewareFunc
- type N400
- type N401
- type N403
- type N404
- type N500
- type PatchTeamsTeamIDJSONRequestBody
- type PostTeamsTeamIDMembersJSONRequestBody
- type SandboxID
- type SandboxRecord
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) DeleteTeamsTeamIDMembersUserId(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetBuilds(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetBuildsBuildId(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetBuildsStatuses(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetHealth(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetSandboxesSandboxIDRecord(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTeams(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTeamsResolve(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTeamsTeamIDMembers(c *gin.Context)
- func (siw *ServerInterfaceWrapper) GetTemplatesDefaults(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PatchTeamsTeamID(c *gin.Context)
- func (siw *ServerInterfaceWrapper) PostTeamsTeamIDMembers(c *gin.Context)
- type TeamID
- type TeamMember
- type TeamMembersResponse
- type TeamResolveResponse
- type TeamSlug
- type UpdateTeamRequest
- type UpdateTeamResponse
- type UserId
- type UserTeam
- type UserTeamLimits
- type UserTeamsResponse
Constants ¶
const ( Supabase1TokenAuthScopes = "Supabase1TokenAuth.Scopes" Supabase2TeamAuthScopes = "Supabase2TeamAuth.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 AddTeamMemberRequest ¶
type AddTeamMemberRequest struct {
Email openapi_types.Email `json:"email"`
}
AddTeamMemberRequest defines model for AddTeamMemberRequest.
type BuildIdOrTemplate ¶
type BuildIdOrTemplate = string
BuildIdOrTemplate defines model for build_id_or_template.
type BuildInfo ¶
type BuildInfo struct {
// CreatedAt Build creation timestamp in RFC3339 format.
CreatedAt time.Time `json:"createdAt"`
// FinishedAt Build completion timestamp in RFC3339 format, if finished.
FinishedAt *time.Time `json:"finishedAt"`
// Names Template names related to this build, if available.
Names *[]string `json:"names"`
// Status Build status mapped for dashboard clients.
Status BuildStatus `json:"status"`
// StatusMessage Failure message when status is `failed`, otherwise `null`.
StatusMessage *string `json:"statusMessage"`
}
BuildInfo defines model for BuildInfo.
type BuildStatus ¶
type BuildStatus string
BuildStatus Build status mapped for dashboard clients.
const ( Building BuildStatus = "building" Failed BuildStatus = "failed" Success BuildStatus = "success" )
Defines values for BuildStatus.
type BuildStatusItem ¶
type BuildStatusItem struct {
// FinishedAt Build completion timestamp in RFC3339 format, if finished.
FinishedAt *time.Time `json:"finishedAt"`
// Id Identifier of the build.
Id openapi_types.UUID `json:"id"`
// Status Build status mapped for dashboard clients.
Status BuildStatus `json:"status"`
// StatusMessage Failure message when status is `failed`, otherwise `null`.
StatusMessage *string `json:"statusMessage"`
}
BuildStatusItem defines model for BuildStatusItem.
type BuildStatuses ¶
type BuildStatuses = []BuildStatus
BuildStatuses defines model for build_statuses.
type BuildsListResponse ¶
type BuildsListResponse struct {
Data []ListedBuild `json:"data"`
// NextCursor Cursor to pass to the next list request, or `null` if there is no next page.
NextCursor *string `json:"nextCursor"`
}
BuildsListResponse defines model for BuildsListResponse.
type BuildsStatusesResponse ¶
type BuildsStatusesResponse struct {
// BuildStatuses List of build statuses
BuildStatuses []BuildStatusItem `json:"buildStatuses"`
}
BuildsStatusesResponse defines model for BuildsStatusesResponse.
type DefaultTemplate ¶
type DefaultTemplate struct {
Aliases []DefaultTemplateAlias `json:"aliases"`
BuildCount int32 `json:"buildCount"`
BuildId openapi_types.UUID `json:"buildId"`
CreatedAt time.Time `json:"createdAt"`
EnvdVersion *string `json:"envdVersion"`
Id string `json:"id"`
Public bool `json:"public"`
RamMb int64 `json:"ramMb"`
SpawnCount int64 `json:"spawnCount"`
TotalDiskSizeMb *int64 `json:"totalDiskSizeMb"`
Vcpu int64 `json:"vcpu"`
}
DefaultTemplate defines model for DefaultTemplate.
type DefaultTemplateAlias ¶
type DefaultTemplateAlias struct {
Alias string `json:"alias"`
Namespace *string `json:"namespace"`
}
DefaultTemplateAlias defines model for DefaultTemplateAlias.
type DefaultTemplatesResponse ¶
type DefaultTemplatesResponse struct {
Templates []DefaultTemplate `json:"templates"`
}
DefaultTemplatesResponse defines model for DefaultTemplatesResponse.
type Error ¶
type Error struct {
// Code Error code.
Code int32 `json:"code"`
// Message Error message.
Message string `json:"message"`
}
Error defines model for Error.
type GetBuildsParams ¶
type GetBuildsParams struct {
// BuildIdOrTemplate Optional filter by build identifier, template identifier, or template alias.
BuildIdOrTemplate *BuildIdOrTemplate `form:"build_id_or_template,omitempty" json:"build_id_or_template,omitempty"`
// Statuses Comma-separated list of build statuses to include.
Statuses *BuildStatuses `form:"statuses,omitempty" json:"statuses,omitempty"`
// Limit Maximum number of items to return per page.
Limit *BuildsLimit `form:"limit,omitempty" json:"limit,omitempty"`
// Cursor Cursor returned by the previous list response in `created_at|build_id` format.
Cursor *BuildsCursor `form:"cursor,omitempty" json:"cursor,omitempty"`
}
GetBuildsParams defines parameters for GetBuilds.
type GetBuildsStatusesParams ¶
type GetBuildsStatusesParams struct {
// BuildIds Comma-separated list of build IDs to get statuses for.
BuildIds BuildIds `form:"build_ids" json:"build_ids"`
}
GetBuildsStatusesParams defines parameters for GetBuildsStatuses.
type GetTeamsResolveParams ¶
type GetTeamsResolveParams struct {
// Slug Team slug to resolve.
Slug TeamSlug `form:"slug" json:"slug"`
}
GetTeamsResolveParams defines parameters for GetTeamsResolve.
type GinServerOptions ¶
type GinServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
ErrorHandler func(*gin.Context, error, int)
}
GinServerOptions provides options for the Gin server.
type HealthResponse ¶
type HealthResponse struct {
// Message Human-readable health check result.
Message string `json:"message"`
}
HealthResponse defines model for HealthResponse.
type ListedBuild ¶
type ListedBuild struct {
// CreatedAt Build creation timestamp in RFC3339 format.
CreatedAt time.Time `json:"createdAt"`
// FinishedAt Build completion timestamp in RFC3339 format, if finished.
FinishedAt *time.Time `json:"finishedAt"`
// Id Identifier of the build.
Id openapi_types.UUID `json:"id"`
// Status Build status mapped for dashboard clients.
Status BuildStatus `json:"status"`
// StatusMessage Failure message when status is `failed`, otherwise `null`.
StatusMessage *string `json:"statusMessage"`
// Template Template alias when present, otherwise template ID.
Template string `json:"template"`
// TemplateId Identifier of the template.
TemplateId string `json:"templateId"`
}
ListedBuild defines model for ListedBuild.
type MiddlewareFunc ¶
type PatchTeamsTeamIDJSONRequestBody ¶
type PatchTeamsTeamIDJSONRequestBody = UpdateTeamRequest
PatchTeamsTeamIDJSONRequestBody defines body for PatchTeamsTeamID for application/json ContentType.
type PostTeamsTeamIDMembersJSONRequestBody ¶
type PostTeamsTeamIDMembersJSONRequestBody = AddTeamMemberRequest
PostTeamsTeamIDMembersJSONRequestBody defines body for PostTeamsTeamIDMembers for application/json ContentType.
type SandboxRecord ¶
type SandboxRecord struct {
// Alias Alias of the template
Alias *string `json:"alias,omitempty"`
// CpuCount CPU cores for the sandbox
CpuCount CPUCount `json:"cpuCount"`
// DiskSizeMB Disk size for the sandbox in MiB
DiskSizeMB DiskSizeMB `json:"diskSizeMB"`
// Domain Base domain where the sandbox traffic is accessible
Domain *string `json:"domain"`
// MemoryMB Memory for the sandbox in MiB
MemoryMB MemoryMB `json:"memoryMB"`
// SandboxID Identifier of the sandbox
SandboxID string `json:"sandboxID"`
// StartedAt Time when the sandbox was started
StartedAt time.Time `json:"startedAt"`
// StoppedAt Time when the sandbox was stopped
StoppedAt *time.Time `json:"stoppedAt"`
// TemplateID Identifier of the template from which is the sandbox created
TemplateID string `json:"templateID"`
}
SandboxRecord defines model for SandboxRecord.
type ServerInterface ¶
type ServerInterface interface {
// List team builds
// (GET /builds)
GetBuilds(c *gin.Context, params GetBuildsParams)
// Get build statuses
// (GET /builds/statuses)
GetBuildsStatuses(c *gin.Context, params GetBuildsStatusesParams)
// Get build details
// (GET /builds/{build_id})
GetBuildsBuildId(c *gin.Context, buildId BuildId)
// Health check
// (GET /health)
GetHealth(c *gin.Context)
// Get sandbox record
// (GET /sandboxes/{sandboxID}/record)
GetSandboxesSandboxIDRecord(c *gin.Context, sandboxID SandboxID)
// List user teams
// (GET /teams)
GetTeams(c *gin.Context)
// Resolve team identity
// (GET /teams/resolve)
GetTeamsResolve(c *gin.Context, params GetTeamsResolveParams)
// Update team
// (PATCH /teams/{teamID})
PatchTeamsTeamID(c *gin.Context, teamID TeamID)
// List team members
// (GET /teams/{teamID}/members)
GetTeamsTeamIDMembers(c *gin.Context, teamID TeamID)
// Add team member
// (POST /teams/{teamID}/members)
PostTeamsTeamIDMembers(c *gin.Context, teamID TeamID)
// Remove team member
// (DELETE /teams/{teamID}/members/{userId})
DeleteTeamsTeamIDMembersUserId(c *gin.Context, teamID TeamID, userId UserId)
// List default templates
// (GET /templates/defaults)
GetTemplatesDefaults(c *gin.Context)
}
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) DeleteTeamsTeamIDMembersUserId ¶
func (siw *ServerInterfaceWrapper) DeleteTeamsTeamIDMembersUserId(c *gin.Context)
DeleteTeamsTeamIDMembersUserId operation middleware
func (*ServerInterfaceWrapper) GetBuilds ¶
func (siw *ServerInterfaceWrapper) GetBuilds(c *gin.Context)
GetBuilds operation middleware
func (*ServerInterfaceWrapper) GetBuildsBuildId ¶
func (siw *ServerInterfaceWrapper) GetBuildsBuildId(c *gin.Context)
GetBuildsBuildId operation middleware
func (*ServerInterfaceWrapper) GetBuildsStatuses ¶
func (siw *ServerInterfaceWrapper) GetBuildsStatuses(c *gin.Context)
GetBuildsStatuses operation middleware
func (*ServerInterfaceWrapper) GetHealth ¶
func (siw *ServerInterfaceWrapper) GetHealth(c *gin.Context)
GetHealth operation middleware
func (*ServerInterfaceWrapper) GetSandboxesSandboxIDRecord ¶
func (siw *ServerInterfaceWrapper) GetSandboxesSandboxIDRecord(c *gin.Context)
GetSandboxesSandboxIDRecord operation middleware
func (*ServerInterfaceWrapper) GetTeams ¶
func (siw *ServerInterfaceWrapper) GetTeams(c *gin.Context)
GetTeams operation middleware
func (*ServerInterfaceWrapper) GetTeamsResolve ¶
func (siw *ServerInterfaceWrapper) GetTeamsResolve(c *gin.Context)
GetTeamsResolve operation middleware
func (*ServerInterfaceWrapper) GetTeamsTeamIDMembers ¶
func (siw *ServerInterfaceWrapper) GetTeamsTeamIDMembers(c *gin.Context)
GetTeamsTeamIDMembers operation middleware
func (*ServerInterfaceWrapper) GetTemplatesDefaults ¶
func (siw *ServerInterfaceWrapper) GetTemplatesDefaults(c *gin.Context)
GetTemplatesDefaults operation middleware
func (*ServerInterfaceWrapper) PatchTeamsTeamID ¶
func (siw *ServerInterfaceWrapper) PatchTeamsTeamID(c *gin.Context)
PatchTeamsTeamID operation middleware
func (*ServerInterfaceWrapper) PostTeamsTeamIDMembers ¶
func (siw *ServerInterfaceWrapper) PostTeamsTeamIDMembers(c *gin.Context)
PostTeamsTeamIDMembers operation middleware
type TeamMember ¶
type TeamMember struct {
AddedBy *openapi_types.UUID `json:"addedBy"`
CreatedAt *time.Time `json:"createdAt"`
Email string `json:"email"`
Id openapi_types.UUID `json:"id"`
IsDefault bool `json:"isDefault"`
}
TeamMember defines model for TeamMember.
type TeamMembersResponse ¶
type TeamMembersResponse struct {
Members []TeamMember `json:"members"`
}
TeamMembersResponse defines model for TeamMembersResponse.
type TeamResolveResponse ¶
type TeamResolveResponse struct {
Id openapi_types.UUID `json:"id"`
Slug string `json:"slug"`
}
TeamResolveResponse defines model for TeamResolveResponse.
type UpdateTeamRequest ¶
type UpdateTeamRequest struct {
Name *string `json:"name,omitempty"`
ProfilePictureUrl *string `json:"profilePictureUrl"`
}
UpdateTeamRequest defines model for UpdateTeamRequest.
type UpdateTeamResponse ¶
type UpdateTeamResponse struct {
Id openapi_types.UUID `json:"id"`
Name string `json:"name"`
ProfilePictureUrl *string `json:"profilePictureUrl"`
}
UpdateTeamResponse defines model for UpdateTeamResponse.
type UserTeam ¶
type UserTeam struct {
BlockedReason *string `json:"blockedReason"`
CreatedAt time.Time `json:"createdAt"`
Email string `json:"email"`
Id openapi_types.UUID `json:"id"`
IsBanned bool `json:"isBanned"`
IsBlocked bool `json:"isBlocked"`
IsDefault bool `json:"isDefault"`
Limits UserTeamLimits `json:"limits"`
Name string `json:"name"`
ProfilePictureUrl *string `json:"profilePictureUrl"`
Slug string `json:"slug"`
Tier string `json:"tier"`
}
UserTeam defines model for UserTeam.
type UserTeamLimits ¶
type UserTeamLimits struct {
ConcurrentSandboxes int32 `json:"concurrentSandboxes"`
ConcurrentTemplateBuilds int32 `json:"concurrentTemplateBuilds"`
DiskMb int32 `json:"diskMb"`
MaxLengthHours int64 `json:"maxLengthHours"`
MaxRamMb int32 `json:"maxRamMb"`
MaxVcpu int32 `json:"maxVcpu"`
}
UserTeamLimits defines model for UserTeamLimits.
type UserTeamsResponse ¶
type UserTeamsResponse struct {
Teams []UserTeam `json:"teams"`
}
UserTeamsResponse defines model for UserTeamsResponse.