Documentation
¶
Overview ¶
Package model provides the models for the Zeabur API.
Index ¶
- type BannedReasonType
- type Connection
- type CreateServiceInput
- type Deployment
- type Deployments
- type Domain
- type Domains
- type Edge
- type Environment
- type Environments
- type ExportedTemplate
- type GenericRegion
- type GitRepo
- type GitTrigger
- type Log
- type Logs
- type Map
- type MarketplaceItem
- type MetricType
- type PageInfo
- type PrebuiltItem
- type Project
- type ProjectConnection
- type ProjectEdge
- type ProjectUsage
- type Projects
- type Region
- type RegionProvider
- type RepoConfig
- type RepoConfigs
- type Server
- type Service
- type ServiceDetail
- type ServiceDetails
- type ServiceInTemplate
- type ServiceInstruction
- type ServiceInstructions
- type ServiceMetric
- type ServiceSpecConfigInput
- type ServiceSpecConnectionInstructionType
- type ServiceSpecEnvInput
- type ServiceSpecInitRuleInput
- type ServiceSpecInitVolumeMountInput
- type ServiceSpecPortInput
- type ServiceSpecSchemaInput
- type ServiceSpecSourceInput
- type ServiceSpecVolumeEntryInput
- type ServiceTemplate
- type Services
- type Tabler
- type TempTCPPort
- type Template
- type TemplateConnection
- type TemplateEdge
- type Templates
- type User
- type Variable
- type Variables
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BannedReasonType ¶
type BannedReasonType string
BannedReasonType is the type of reason a user is banned
const ( BannedReasonVPN BannedReasonType = "VPN" BannedReasonMiner BannedReasonType = "MINER" BannedReasonAggregator BannedReasonType = "AGGREGATOR" BannedReasonMirror BannedReasonType = "MIRROR" BannedReasonDMCA BannedReasonType = "DMCA" BannedReasonIllegal BannedReasonType = "ILLEGAL" )
valid banned reasons
type Connection ¶
type CreateServiceInput ¶
type CreateServiceInput struct {
ProjectID string `json:"projectID" graphql:"projectID"`
Name string `json:"name" graphql:"name"`
Template ServiceTemplate `graphql:"template"`
}
type Deployment ¶
type Deployment struct {
ID string `graphql:"_id"`
ProjectID string `json:"projectID" graphql:"projectID"`
ServiceID string `json:"serviceID" graphql:"serviceID"`
EnvironmentID string `json:"environmentID" graphql:"environmentID"`
GitProvider string `json:"gitProvider" graphql:"gitProvider"`
RepoOwner string `json:"repoOwner" graphql:"repoOwner"`
RepoName string `json:"repoName" graphql:"repoName"`
Ref string `json:"ref" graphql:"ref"`
CommitSHA string `json:"commitSHA" graphql:"commitSHA"`
CommitMessage string `json:"commitMessage" graphql:"commitMessage"`
PlanType string `json:"planType" graphql:"planType"`
CreatedAt time.Time `json:"createdAt" graphql:"createdAt"`
ScheduledAt time.Time `json:"scheduledAt" graphql:"scheduledAt"`
StartedAt time.Time `json:"startedAt" graphql:"startedAt"`
FinishedAt time.Time `json:"finishedAt" graphql:"finishedAt"`
Status string `json:"status" graphql:"status"`
}
func (*Deployment) Header ¶
func (d *Deployment) Header() []string
func (*Deployment) Rows ¶
func (d *Deployment) Rows() [][]string
type Deployments ¶
type Deployments []*Deployment
func (Deployments) Header ¶
func (d Deployments) Header() []string
func (Deployments) Rows ¶
func (d Deployments) Rows() [][]string
type Domain ¶
type Domain struct {
ID string `json:"id" graphql:"_id"`
Domain string `json:"domain" graphql:"domain"`
ServiceID string `json:"serviceID" graphql:"serviceID"`
EnvironmentID string `json:"environmentID" graphql:"environmentID"`
ProjectID string `json:"projectID" graphql:"projectID"`
PortName string `json:"portName" graphql:"portName"`
RedirectTo string `json:"redirectTo" graphql:"redirectTo"`
Status string `json:"status" graphql:"status"`
IsGenerated bool `json:"isGenerated" graphql:"isGenerated"`
CreatedAt time.Time `json:"createdAt" graphql:"createdAt"`
}
type Environment ¶
type Environment struct {
CreatedAt time.Time `graphql:"createdAt"`
ID string `graphql:"_id"`
Name string `graphql:"name"`
ProjectID string `graphql:"projectID"`
}
Environment is the simplest model of environment, which is used in most queries.
func (*Environment) Header ¶
func (e *Environment) Header() []string
func (*Environment) Rows ¶
func (e *Environment) Rows() [][]string
type Environments ¶
type Environments []*Environment
func (Environments) Header ¶
func (e Environments) Header() []string
func (Environments) Rows ¶
func (e Environments) Rows() [][]string
type ExportedTemplate ¶
type ExportedTemplate struct {
ResourceYAML string `graphql:"resourceYAML"`
Warnings []string `graphql:"warnings"`
}
ExportedTemplate is the exported template of the given project.
type GenericRegion ¶
type GitTrigger ¶
type GitTrigger struct {
BranchName string `json:"branchName" graphql:"branchName"`
Provider string `json:"provider" graphql:"provider"`
RepoID int `json:"repoID" graphql:"repoID"`
}
GitTrigger represents a git trigger.
type Log ¶
type MarketplaceItem ¶
type MetricType ¶
type MetricType string
MetricType is the type of metric.
const ( MetricTypeCPU MetricType = "CPU" MetricTypeMemory MetricType = "MEMORY" MetricTypeNetwork MetricType = "NETWORK" )
valid metric types
func (MetricType) GetGraphQLType ¶
func (m MetricType) GetGraphQLType() string
func (MetricType) WithMeasureUnit ¶
func (m MetricType) WithMeasureUnit(v float64) string
type PageInfo ¶
type PageInfo struct {
StartCursor string `json:"startCursor" graphql:"startCursor"`
EndCursor string `json:"endCursor" graphql:"endCursor"`
TotalCount int `json:"totalCount" graphql:"totalCount"`
HasNextPage bool `json:"hasNextPage" graphql:"hasNextPage"`
HasPreviousPage bool `json:"hasPreviousPage" graphql:"hasPreviousPage"`
}
PageInfo is the pagination information
type PrebuiltItem ¶
type Project ¶
type Project struct {
ID string `graphql:"_id"`
Name string `graphql:"name"`
Description string `graphql:"description"`
//Environments []Environment `graphql:"environments"`
CreatedAt time.Time `graphql:"createdAt"`
//Owner User `graphql:"owner"`
//Collaborators []User `graphql:"collaborators"`
IconURL string `graphql:"iconURL"`
//Services []Service `graphql:"services"`
Region Region `graphql:"region"`
}
Project is the simplest model of project, which is used in most queries.
type ProjectConnection ¶
type ProjectConnection struct {
PageInfo *PageInfo `json:"pageInfo"`
Edges []*ProjectEdge `json:"edges"`
}
ProjectConnection is a connection to a list of items.
type ProjectEdge ¶
ProjectEdge is an edge in a connection.
type ProjectUsage ¶
type ProjectUsage struct {
// the project this usage is for
Project *Project `json:"project"`
// the beginning of the time period
From time.Time `json:"from"`
// the end of the time period
To time.Time `json:"to"`
// the total number of cpu used (in vCPU-minutes)
CPU float64 `json:"cpu"`
// the total number of memory used (in MB-minutes)
Memory int `json:"memory"`
}
ProjectUsage is a summary of the usage of a project in a given time period.
type Region ¶
type Region struct {
Available bool `graphql:"available"`
Description string `graphql:"description"`
ID string `graphql:"id"`
Name string `graphql:"name"`
Coordinates []float64 `graphql:"coordinates"`
Provider RegionProvider `graphql:"provider"`
}
func (Region) IsAvailable ¶
type RegionProvider ¶
type RegionProvider string
type RepoConfig ¶
type RepoConfigs ¶
type RepoConfigs []*RepoConfig
type Server ¶
type Server struct {
ID string `graphql:"_id"`
Country *string `graphql:"country"`
City *string `graphql:"city"`
IP string `graphql:"ip"`
Name string `graphql:"name"`
}
func (Server) IsAvailable ¶
type Service ¶
type Service struct {
ID string `graphql:"_id"`
Name string `graphql:"name"`
// Template ServiceTemplate `graphql:"template"`
Project *struct {
ID string `graphql:"_id"`
} `graphql:"project"`
CreatedAt time.Time `graphql:"createdAt"`
// MarketItemCode is the code of the item in the marketplace. Only used if Template is ServiceTemplateMarketplace.
MarketItemCode *string `graphql:"marketItemCode"`
CustomBuildCommand *string `graphql:"customBuildCommand"`
CustomStartCommand *string `graphql:"customStartCommand"`
OutputDir *string `graphql:"outputDir"`
RootDirectory string `graphql:"rootDirectory"`
Template string `graphql:"template"`
WatchPaths []string `graphql:"watchPaths"`
}
Service is the simplest model of service, which is used in most queries.
type ServiceDetail ¶
type ServiceDetail struct {
Service `graphql:"... on Service"`
GitTrigger *GitTrigger `graphql:"gitTrigger(environmentID: $environmentID)"`
ConsoleURL string `graphql:"consoleURL(environmentID: $environmentID)"`
Status string `graphql:"status(environmentID: $environmentID)"`
Domains []Domain `graphql:"domains(environmentID: $environmentID)"`
}
ServiceDetail has more information related to specific environment.
func (*ServiceDetail) Header ¶
func (s *ServiceDetail) Header() []string
func (*ServiceDetail) Rows ¶
func (s *ServiceDetail) Rows() [][]string
type ServiceDetails ¶
type ServiceDetails []*ServiceDetail
func (ServiceDetails) Header ¶
func (s ServiceDetails) Header() []string
func (ServiceDetails) Rows ¶
func (s ServiceDetails) Rows() [][]string
type ServiceInTemplate ¶
type ServiceInTemplate struct {
BranchName string `json:"branchName"`
CustomBuildCommand string `json:"customBuildCommand"`
CustomStartCommand string `json:"customStartCommand"`
DomainKey string `json:"domainKey"`
GitNamespaceID int `json:"gitNamespaceID"`
GitRepoID int `json:"gitRepoID"`
MarketplaceItem MarketplaceItem `json:"marketplaceItem"`
Name string `json:"name"`
OutputDir string `json:"outputDir"`
RootDirectory string `json:"rootDirectory"`
Template ServiceTemplate `json:"template"`
Variables map[string]interface{} `json:"variables"`
WatchPaths []string `json:"watchPaths"`
}
type ServiceInstruction ¶
type ServiceInstruction struct {
Category string `graphql:"category"`
Content string `graphql:"content"`
Title string `graphql:"title"`
Type ServiceSpecConnectionInstructionType `graphql:"type"`
}
type ServiceInstructions ¶
type ServiceInstructions struct {
Instructions []ServiceInstruction `graphql:"instructions"`
}
type ServiceMetric ¶
type ServiceMetric struct {
Metrics []struct {
Timestamp time.Time `json:"timestamp" graphql:"timestamp"`
Value float64 `json:"value" graphql:"value"`
} `` /* 153-byte string literal not displayed */
}
ServiceMetric is a metric of a service.
type ServiceSpecConfigInput ¶
type ServiceSpecConnectionInstructionType ¶
type ServiceSpecConnectionInstructionType string
const ( ServiceSpecConnectionInstructionTypePassword ServiceSpecConnectionInstructionType = "PASSWORD" ServiceSpecConnectionInstructionTypeURL ServiceSpecConnectionInstructionType = "URL" ServiceSpecConnectionInstructionTypeText ServiceSpecConnectionInstructionType = "TEXT" )
type ServiceSpecEnvInput ¶
type ServiceSpecInitRuleInput ¶
type ServiceSpecInitRuleInput struct {
ID string `json:"id" graphql:"id"`
Image string `json:"image" graphql:"image"`
Command []string `json:"command" graphql:"command"`
Volumes []ServiceSpecInitVolumeMountInput `json:"volumes" graphql:"volumes"`
}
type ServiceSpecPortInput ¶
type ServiceSpecSchemaInput ¶
type ServiceSpecSchemaInput struct {
ID string `json:"id" graphql:"id"`
Name string `json:"name" graphql:"name"`
Description string `json:"description" graphql:"description"`
Tags []string `json:"tags" graphql:"tags"`
Icon string `json:"icon" graphql:"icon"`
Docs string `json:"docs" graphql:"docs"`
Source *ServiceSpecSourceInput `json:"source" graphql:"source"`
Ports []ServiceSpecPortInput `json:"ports" graphql:"ports"`
Volumes []ServiceSpecVolumeEntryInput `json:"volumes" graphql:"volumes"`
Instructions []ServiceInstruction `json:"instructions" graphql:"instructions"`
Env []ServiceSpecEnvInput `json:"env" graphql:"env"`
InitRules []ServiceSpecInitRuleInput `json:"initRules" graphql:"initRules"`
Configs []ServiceSpecConfigInput `json:"configs" graphql:"configs"`
}
type ServiceSpecSourceInput ¶
type ServiceSpecSourceInput struct {
Image string `json:"image" graphql:"image"`
Command []string `json:"command" graphql:"command"`
Args []string `json:"args" graphql:"args"`
// Git only fields
Source string `json:"source,omitempty" graphql:"source"`
RepoID int `json:"repoID,omitempty" graphql:"repoID"`
Branch string `json:"branch,omitempty" graphql:"branch"`
SubModuleName string `json:"subModuleName,omitempty" graphql:"subModuleName"`
WatchPaths []string `json:"watchPaths,omitempty" graphql:"watchPaths"`
}
type ServiceTemplate ¶
type ServiceTemplate string
const ( RegionProviderAWS ServiceTemplate = "AWS" RegionProviderGCP ServiceTemplate = "GCP" )
const ( ServiceTemplateGit ServiceTemplate = "GIT" ServiceTemplateMarketplace ServiceTemplate = "MARKETPLACE" )
type TempTCPPort ¶
type TempTCPPort struct {
ServiceID string `json:"serviceID" graphql:"serviceID"`
EnvironmentID string `json:"environmentID" graphql:"environmentID"`
TargetPort int `json:"targetPort" graphql:"targetPort"`
NodePort int `json:"nodePort" graphql:"nodePort"`
RemainSeconds int `json:"remainSeconds" graphql:"remainSeconds"`
}
TempTCPPort is a temporary TCP port.
type Template ¶
type Template struct {
CreatedAt time.Time `graphql:"createdAt"`
DeploymentCnt int `graphql:"deploymentCnt"`
Code string `graphql:"code"`
Description string `graphql:"description"`
Name string `graphql:"name"`
PreviewURL string `graphql:"previewURL"`
Readme string `graphql:"readme"`
Tags []string `graphql:"tags"`
}
type TemplateConnection ¶
type TemplateConnection struct {
PageInfo *PageInfo `json:"pageInfo"`
Edges []*TemplateEdge `json:"edges"`
}
type TemplateEdge ¶
type User ¶
type User struct {
CreatedAt *time.Time `json:"createdAt" graphql:"createdAt"`
BannedAt *time.Time `json:"bannedAt" graphql:"bannedAt"`
//BannedReason *BannedReasonType `json:"bannedReason" graphql:"bannedReason"`
//EmailPreference map[string]bool `json:"emailPreference" graphql:"emailPreference"`
AgreedAt *time.Time `json:"agreedAt" graphql:"agreedAt"`
// DiscordID is the user's Discord ID.
DiscordID *string `json:"discordID" graphql:"discordID"`
ID string `json:"_id" graphql:"_id"`
Name string `json:"name" graphql:"name"`
Email string `json:"email" graphql:"email"`
Username string `json:"username" graphql:"username"`
Language string `json:"language" graphql:"language"`
AvatarURL string `json:"avatarUrl" graphql:"avatarURL"`
GitHubID int64 `json:"githubID" graphql:"githubID"`
}
User is the simplest model of user, which is used in most queries.