Documentation ¶
Index ¶
- Constants
- Variables
- type Application
- type ApplicationConfig
- func (app *ApplicationConfig) AddNameServers(servers ...string)
- func (app *ApplicationConfig) GetApplicationPort() int
- func (app *ApplicationConfig) GetBuildCommands() []string
- func (app *ApplicationConfig) GetCPULimit() int64
- func (app *ApplicationConfig) GetContainerID() string
- func (app *ApplicationConfig) GetContainerPort() int
- func (app *ApplicationConfig) GetDockerImage() string
- func (app *ApplicationConfig) GetEnvVars() map[string]interface{}
- func (app *ApplicationConfig) GetGitAccessToken() string
- func (app *ApplicationConfig) GetGitRepositoryBranch() string
- func (app *ApplicationConfig) GetGitRepositoryURL() string
- func (app *ApplicationConfig) GetIndex() string
- func (app *ApplicationConfig) GetMemoryLimit() int64
- func (app *ApplicationConfig) GetName() string
- func (app *ApplicationConfig) GetNameServers() []string
- func (app *ApplicationConfig) GetRunCommands() []string
- func (app *ApplicationConfig) HasConfGenerator() bool
- func (app *ApplicationConfig) HasGitAccessToken() bool
- func (app *ApplicationConfig) HasRcFile() bool
- func (app *ApplicationConfig) InvokeConfGenerator(name, index string) string
- func (app *ApplicationConfig) SetAppURL(appURL string)
- func (app *ApplicationConfig) SetCloudflareID(cloudflareID string)
- func (app *ApplicationConfig) SetConfGenerator(gen func(string, string) string)
- func (app *ApplicationConfig) SetContainerID(id string)
- func (app *ApplicationConfig) SetContainerPort(port int)
- func (app *ApplicationConfig) SetDateTime()
- func (app *ApplicationConfig) SetDockerImage(image string)
- func (app *ApplicationConfig) SetHostIP(IP string)
- func (app *ApplicationConfig) SetInstanceType(instanceType string)
- func (app *ApplicationConfig) SetLanguage(language string)
- func (app *ApplicationConfig) SetNameServers(servers []string)
- func (app *ApplicationConfig) SetOwner(owner string)
- func (app *ApplicationConfig) SetPublicIP(IP string)
- func (app *ApplicationConfig) SetSSHCmd(port int, appName, IP string)
- func (app *ApplicationConfig) SetSuccess(success bool)
- type ApplicationContainer
- type CPUStats
- type CPUUsageStats
- type Context
- type Database
- type DatabaseConfig
- func (db *DatabaseConfig) GetContainerPort() int
- func (db *DatabaseConfig) GetName() string
- func (db *DatabaseConfig) GetPassword() string
- func (db *DatabaseConfig) GetUser() string
- func (db *DatabaseConfig) SetCloudflareID(cloudflareID string)
- func (db *DatabaseConfig) SetContainerPort(port int)
- func (db *DatabaseConfig) SetDateTime()
- func (db *DatabaseConfig) SetDbURL(dbURL string)
- func (db *DatabaseConfig) SetHostIP(IP string)
- func (db *DatabaseConfig) SetInstanceType(instanceType string)
- func (db *DatabaseConfig) SetLanguage(language string)
- func (db *DatabaseConfig) SetOwner(owner string)
- func (db *DatabaseConfig) SetPublicIP(IP string)
- func (db *DatabaseConfig) SetSuccess(success bool)
- func (db *DatabaseConfig) SetUser(user string)
- type DatabaseContainer
- type Email
- type Git
- type Instance
- type InstanceBindings
- type LoadBalancer
- type Login
- type M
- type MemoryStats
- type Metrics
- type PasswordUpdate
- type ProxyInfo
- type ProxyStorage
- type RecordStorage
- type RepositoryRequest
- type RepositoryResponse
- type Resources
- type ResponseError
- type Stats
- type UpdateContext
- type UpdateGit
- type UpdatePayload
- type User
- func (user *User) GetEmail() string
- func (user *User) GetName() string
- func (user *User) GetPassword() string
- func (user *User) GetUUID() string
- func (user *User) IsAdmin() bool
- func (user *User) SetAdmin(admin bool)
- func (user *User) SetEmail(email string)
- func (user *User) SetPassword(password string)
- func (user *User) SetSuccess(success bool)
- func (user *User) SetUUID(uuid string)
Constants ¶
const ( // Master holds the name of `master` microservice Master = "master" // AppMaker holds the name of `appmaker` microservice AppMaker = "appmaker" // DbMaker holds the name of `dbmaker` microservice DbMaker = "dbmaker" // MySQL holds the name of `mysql` component under `dbmaker` MySQL = "mysql" // MongoDB holds the name of `mongodb` mongo component under `dbmaker` MongoDB = "mongodb" // PostgreSQL holds the name of `postgresql` component under 'dbmaker' PostgreSQL = "postgresql" // MongoDBGasper holds the name of `mongodb_gasper` mongo component under `master` MongoDBGasper = "mongodb_gasper" //RedisGasper holds the name of `redis_gasper` redis component under `master` RedisGasper = "redis_gasper" // Redis holds the name of `redis` component under 'dbmaker' Redis = "redis" // GenSSH holds the name of `genssh` microservice GenSSH = "genssh" // GenProxy holds the name of `genproxy` microservice GenProxy = "genproxy" // GenDNS holds the name of `gendns` microservice GenDNS = "gendns" // GenProxySSL holds the name of `genproxy` microservice with SSL support GenProxySSL = "genproxy_ssl" // Jikan holds the name of `jikan` microservice Jikan = "jikan" // DefaultMemory is the default memory allotted to a container DefaultMemory = 0.5 // DefaultCPUs is the default number of CPUs allotted to a container DefaultCPUs = 0.25 )
Variables ¶
var ErrNoContainer = errors.New("Error response from daemon: No such container: ")
ErrNoContainer is the error message when a container lookup fails
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application interface { GetName() string GetGitRepositoryURL() string GetGitRepositoryBranch() string HasGitAccessToken() bool GetGitAccessToken() string GetIndex() string GetApplicationPort() int HasRcFile() bool GetBuildCommands() []string GetRunCommands() []string GetCPULimit() int64 GetMemoryLimit() int64 GetEnvVars() map[string]interface{} GetNameServers() []string GetDockerImage() string SetContainerID(id string) GetContainerID() string SetContainerPort(port int) GetContainerPort() int HasConfGenerator() bool InvokeConfGenerator(name, index string) string }
Application is the interface for creating an application
type ApplicationConfig ¶
type ApplicationConfig struct { Name string `` /* 288-byte string literal not displayed */ Password string `json:"password" bson:"password" valid:"required~Field 'password' is required but was not provided"` Git Git `json:"git" bson:"git"` Context Context `json:"context" bson:"context"` Resources Resources `json:"resources,omitempty" bson:"resources,omitempty"` Env M `json:"env,omitempty" bson:"env,omitempty"` NameServers []string `json:"name_servers,omitempty" bson:"name_servers,omitempty"` DockerImage string `json:"docker_image" bson:"docker_image"` ContainerID string `json:"container_id" bson:"container_id"` ContainerPort int `json:"container_port" bson:"container_port"` ConfGenerator func(string, string) string `json:"-" bson:"-"` Language string `json:"language" bson:"language"` InstanceType string `json:"instance_type" bson:"instance_type"` CloudflareID string `json:"cloudflare_id,omitempty" bson:"cloudflare_id,omitempty"` AppURL string `json:"app_url,omitempty" bson:"app_url,omitempty"` HostIP string `json:"host_ip,omitempty" bson:"host_ip,omitempty"` PublicIP string `json:"public_ip,omitempty" bson:"public_ip,omitempty"` SSHCmd string `json:"ssh_cmd,omitempty" bson:"ssh_cmd,omitempty"` Owner string `json:"owner,omitempty" bson:"owner,omitempty"` Datetime time.Time `json:"datetime" bson:"datetime"` Success bool `json:"success,omitempty" bson:"-"` }
ApplicationConfig is the configuration required for creating an application
func (*ApplicationConfig) AddNameServers ¶
func (app *ApplicationConfig) AddNameServers(servers ...string)
AddNameServers adds a DNS NameServer to be used by the application's docker container in the application's context
func (*ApplicationConfig) GetApplicationPort ¶
func (app *ApplicationConfig) GetApplicationPort() int
GetApplicationPort returns the port on which the application runs
func (*ApplicationConfig) GetBuildCommands ¶
func (app *ApplicationConfig) GetBuildCommands() []string
GetBuildCommands returns the shell commands used for building the application's dependencies
func (*ApplicationConfig) GetCPULimit ¶
func (app *ApplicationConfig) GetCPULimit() int64
GetCPULimit returns application's CPU Limit in units of NanoCPUs
func (*ApplicationConfig) GetContainerID ¶
func (app *ApplicationConfig) GetContainerID() string
GetContainerID returns the docker container ID in the application's context
func (*ApplicationConfig) GetContainerPort ¶
func (app *ApplicationConfig) GetContainerPort() int
GetContainerPort returns the port to which the container is bound in the host system
func (*ApplicationConfig) GetDockerImage ¶
func (app *ApplicationConfig) GetDockerImage() string
GetDockerImage returns the docker image used for creating container
func (*ApplicationConfig) GetEnvVars ¶
func (app *ApplicationConfig) GetEnvVars() map[string]interface{}
GetEnvVars returns the environment variables to be used inside the docker container
func (*ApplicationConfig) GetGitAccessToken ¶
func (app *ApplicationConfig) GetGitAccessToken() string
GetGitAccessToken returns the application's git access token
func (*ApplicationConfig) GetGitRepositoryBranch ¶
func (app *ApplicationConfig) GetGitRepositoryBranch() string
GetGitRepositoryBranch returns the branch to clone from the application's git repository Default branch is `master`
func (*ApplicationConfig) GetGitRepositoryURL ¶
func (app *ApplicationConfig) GetGitRepositoryURL() string
GetGitRepositoryURL returns the application's git repository URL
func (*ApplicationConfig) GetIndex ¶
func (app *ApplicationConfig) GetIndex() string
GetIndex returns the index file required for starting the application
func (*ApplicationConfig) GetMemoryLimit ¶
func (app *ApplicationConfig) GetMemoryLimit() int64
GetMemoryLimit returns application's Memory Limit in units of bytes
func (*ApplicationConfig) GetName ¶
func (app *ApplicationConfig) GetName() string
GetName returns the application's name
func (*ApplicationConfig) GetNameServers ¶
func (app *ApplicationConfig) GetNameServers() []string
GetNameServers returns the DNS NameServers to be used by the application's docker container
func (*ApplicationConfig) GetRunCommands ¶
func (app *ApplicationConfig) GetRunCommands() []string
GetRunCommands returns the shell commands used for running the application
func (*ApplicationConfig) HasConfGenerator ¶
func (app *ApplicationConfig) HasConfGenerator() bool
HasConfGenerator checks whether a config generator is required for bootstraping the application
func (*ApplicationConfig) HasGitAccessToken ¶
func (app *ApplicationConfig) HasGitAccessToken() bool
HasGitAccessToken checks whether access token is required for cloning the application's git repository
func (*ApplicationConfig) HasRcFile ¶
func (app *ApplicationConfig) HasRcFile() bool
HasRcFile checks if a Run Commands file is required for building and running the application
func (*ApplicationConfig) InvokeConfGenerator ¶
func (app *ApplicationConfig) InvokeConfGenerator(name, index string) string
InvokeConfGenerator invokes the config generator
func (*ApplicationConfig) SetAppURL ¶
func (app *ApplicationConfig) SetAppURL(appURL string)
SetAppURL sets the application's domain URL in its context
func (*ApplicationConfig) SetCloudflareID ¶
func (app *ApplicationConfig) SetCloudflareID(cloudflareID string)
SetCloudflareID sets the application's cloudflare record ID in its context
func (*ApplicationConfig) SetConfGenerator ¶
func (app *ApplicationConfig) SetConfGenerator(gen func(string, string) string)
SetConfGenerator defines a config generator used for applications using nginx Ex :- PHP and Static applications
func (*ApplicationConfig) SetContainerID ¶
func (app *ApplicationConfig) SetContainerID(id string)
SetContainerID sets docker container ID in the application's context
func (*ApplicationConfig) SetContainerPort ¶
func (app *ApplicationConfig) SetContainerPort(port int)
SetContainerPort sets the port to which the container will be bound to in the host system
func (*ApplicationConfig) SetDateTime ¶
func (app *ApplicationConfig) SetDateTime()
SetDateTime sets the date on which the db was created
func (*ApplicationConfig) SetDockerImage ¶
func (app *ApplicationConfig) SetDockerImage(image string)
SetDockerImage defines the docker image to be used for creating the container
func (*ApplicationConfig) SetHostIP ¶
func (app *ApplicationConfig) SetHostIP(IP string)
SetHostIP sets the IP address of the host in which the application is deployed in its context
func (*ApplicationConfig) SetInstanceType ¶
func (app *ApplicationConfig) SetInstanceType(instanceType string)
SetInstanceType sets the application's type of instance in its context
func (*ApplicationConfig) SetLanguage ¶
func (app *ApplicationConfig) SetLanguage(language string)
SetLanguage sets the application's language in its context
func (*ApplicationConfig) SetNameServers ¶
func (app *ApplicationConfig) SetNameServers(servers []string)
SetNameServers sets the DNS NameServers to be used by the application's docker container in the application's context
func (*ApplicationConfig) SetOwner ¶
func (app *ApplicationConfig) SetOwner(owner string)
SetOwner sets the owner of the application in its context The owner is referenced by his/her email ID
func (*ApplicationConfig) SetPublicIP ¶
func (app *ApplicationConfig) SetPublicIP(IP string)
SetPublicIP sets the public IP address of the host in which the application is deployed in its context
func (*ApplicationConfig) SetSSHCmd ¶
func (app *ApplicationConfig) SetSSHCmd(port int, appName, IP string)
SetSSHCmd generates the command to SSH into an application's docker container for the information of the client
func (*ApplicationConfig) SetSuccess ¶
func (app *ApplicationConfig) SetSuccess(success bool)
SetSuccess defines the success of deploying the application
type ApplicationContainer ¶
type ApplicationContainer struct { // Name of the container Name string // Docker image used for creating the container Image string // Port on which an application is running inside the container ApplicationPort int // Port of the docker container in the host system ContainerPort int // Directory inside the docker container for volume mounting purposes WorkDir string // Directory on the host system for volume mounting purposes StoreDir string // Environment variables Env M // Resource limits Memory int64 CPU int64 // DNS nameservers to be used for domain name resolutions within the container NameServers []string }
ApplicationContainer is the configuration for creating a container for running an application
type CPUStats ¶
type CPUStats struct { OnlineCPUs float64 `json:"online_cpus"` CPUUsage CPUUsageStats `json:"cpu_usage"` }
CPUStats defines a struct for storing a container's CPU statistics
type CPUUsageStats ¶
type CPUUsageStats struct {
TotalUsage float64 `json:"total_usage"`
}
CPUUsageStats defines a struct for storing a container's CPU usage statistics
type Context ¶
type Context struct { Index string `json:"index" bson:"index" valid:"required~Field 'index' inside field 'context' was required but was not provided"` Port int `json:"port" bson:"port" valid:"port~Field 'port' inside field 'context' is not a valid port"` RcFile bool `json:"rc_file" bson:"rc_file"` Build []string `json:"build,omitempty" bson:"build,omitempty"` Run []string `json:"run,omitempty" bson:"run,omitempty"` }
Context stores the information related to building and running an application
type Database ¶
type Database interface { GetName() string GetPassword() string GetUser() string SetContainerPort(port int) }
Database is the interface for creating a database
type DatabaseConfig ¶
type DatabaseConfig struct { Name string `` /* 210-byte string literal not displayed */ Password string `json:"password" bson:"password" valid:"required~Field 'password' is required but was not provided"` User string `json:"user,omitempty" bson:"user,omitempty"` InstanceType string `json:"instance_type,omitempty" bson:"instance_type,omitempty"` Language string `json:"language,omitempty" bson:"language,omitempty"` CloudflareID string `json:"cloudflare_id,omitempty" bson:"cloudflare_id,omitempty"` DbURL string `json:"db_url,omitempty" bson:"db_url,omitempty"` HostIP string `json:"host_ip,omitempty" bson:"host_ip,omitempty"` PublicIP string `json:"public_ip,omitempty" bson:"public_ip,omitempty"` ContainerPort int `json:"port,omitempty" bson:"port,omitempty"` Owner string `json:"owner,omitempty" bson:"owner,omitempty"` Datetime time.Time `json:"datetime" bson:"datetime"` Success bool `json:"success,omitempty" bson:"-"` }
DatabaseConfig is the configuration required for creating a database
func (*DatabaseConfig) GetContainerPort ¶
func (db *DatabaseConfig) GetContainerPort() int
GetContainerPort returns the port to which the database's container is bound in the host system
func (*DatabaseConfig) GetName ¶
func (db *DatabaseConfig) GetName() string
GetName returns the database's name
func (*DatabaseConfig) GetPassword ¶
func (db *DatabaseConfig) GetPassword() string
GetPassword returns the database's password
func (*DatabaseConfig) GetUser ¶
func (db *DatabaseConfig) GetUser() string
GetUser returns the database's user
func (*DatabaseConfig) SetCloudflareID ¶
func (db *DatabaseConfig) SetCloudflareID(cloudflareID string)
SetCloudflareID sets the database's cloudflare record ID in its context
func (*DatabaseConfig) SetContainerPort ¶
func (db *DatabaseConfig) SetContainerPort(port int)
SetContainerPort sets the port in which the database server is running in the host system to the database's context
func (*DatabaseConfig) SetDateTime ¶
func (db *DatabaseConfig) SetDateTime()
SetDateTime sets the date on which the app was created
func (*DatabaseConfig) SetDbURL ¶
func (db *DatabaseConfig) SetDbURL(dbURL string)
SetDbURL sets the database's domain URL in its context
func (*DatabaseConfig) SetHostIP ¶
func (db *DatabaseConfig) SetHostIP(IP string)
SetHostIP sets the IP address of the host in which the database is deployed in its context
func (*DatabaseConfig) SetInstanceType ¶
func (db *DatabaseConfig) SetInstanceType(instanceType string)
SetInstanceType sets the database's type of instance in its context
func (*DatabaseConfig) SetLanguage ¶
func (db *DatabaseConfig) SetLanguage(language string)
SetLanguage sets the database's language in its context
func (*DatabaseConfig) SetOwner ¶
func (db *DatabaseConfig) SetOwner(owner string)
SetOwner sets the owner of the database in its context The owner is referenced by his/her email ID
func (*DatabaseConfig) SetPublicIP ¶
func (db *DatabaseConfig) SetPublicIP(IP string)
SetPublicIP sets the public IP address of the host in which the database is deployed in its context
func (*DatabaseConfig) SetSuccess ¶
func (db *DatabaseConfig) SetSuccess(success bool)
SetSuccess defines the success of creating the database
func (*DatabaseConfig) SetUser ¶
func (db *DatabaseConfig) SetUser(user string)
SetUser sets the database's user in its context
type DatabaseContainer ¶
type DatabaseContainer struct { // Name of the container Name string // Docker image used for creating the container Image string // Port on which a database service is running inside the container DatabasePort int // Port of the docker container in the host system ContainerPort int // Directory inside the docker container for volume mounting purposes WorkDir string // Directory on the host system for volume mounting purposes StoreDir string // Custom commands to be executed on a container's startup Cmd []string // Environment variables Env M }
DatabaseContainer is the configuration for creating a container for running an database service
func (*DatabaseContainer) HasCustomCMD ¶
func (containerCfg *DatabaseContainer) HasCustomCMD() bool
HasCustomCMD checks whether a database container needs custom CMD commands on boot
type Email ¶
type Email struct {
Email string `form:"email" json:"email" bson:"email" binding:"required"`
}
Email stores email id of a user
type Git ¶
type Git struct { RepoURL string `` /* 176-byte string literal not displayed */ AccessToken string `json:"access_token,omitempty" bson:"access_token,omitempty"` Branch string `json:"branch,omitempty" bson:"branch,omitempty"` }
Git stores the information related to the application's git repository
type Instance ¶
type Instance interface {
GetName() string
}
Instance is the interface for dealing with both applications and databases
type InstanceBindings ¶
InstanceBindings defines the struct for storing both the instance's server and node urls
type LoadBalancer ¶
type LoadBalancer struct { sync.Mutex // Instances stores the reverse-proxy containers among which network load is balanced Instances []*ProxyInfo // Counter stores the index of the server instance for directing the next request to Counter int }
LoadBalancer is a data structure for load balancing requests among multiple instances using round-robin scheduling algorithm
func NewLoadBalancer ¶
func NewLoadBalancer() *LoadBalancer
NewLoadBalancer returns a new LoadBalancer instance
func (*LoadBalancer) Get ¶
func (lb *LoadBalancer) Get() (*ProxyInfo, bool)
Get returns an instance from the LoadBalancer
func (*LoadBalancer) Update ¶
func (lb *LoadBalancer) Update(newInstances []string)
Update updates the LoadBalancer instances
type Login ¶
type Login struct { Email string `form:"email" json:"email" bson:"email" binding:"required"` Password string `form:"password" json:"password,omitempty" bson:"password" binding:"required"` }
Login is the request body binding for login
func (*Login) GetPassword ¶
GetPassword returns the user's password The password will be hashed if retrieving from database
type MemoryStats ¶
type MemoryStats struct { Usage float64 `json:"usage"` MaxUsage float64 `json:"max_usage"` Limit float64 `json:"limit"` }
MemoryStats defines a struct for storing a container's memory statistics
type Metrics ¶
type Metrics struct { Name string `json:"name" bson:"name"` CPUUsage float64 `json:"cpu_usage" bson:"cpu_usage"` OnlineCPUs float64 `json:"online_cpus" bson:"online_cpus"` MemoryUsage float64 `json:"memory_usage" bson:"memory_usage"` MaxMemoryUsage float64 `json:"max_memory_usage" bson:"max_memory_usage"` MemoryLimit float64 `json:"memory_limit" bson:"memory_limit"` ReadTime int64 `json:"timestamp" bson:"timestamp"` Alive bool `json:"alive" bson:"alive"` HostIP string `json:"host_ip" bson:"host_ip"` Logs string `json:"logs" bson:"logs"` }
Metrics defines a struct for storing container metrics
type PasswordUpdate ¶
type PasswordUpdate struct { OldPassword string `form:"old_password" json:"old_password,omitempty" binding:"required"` NewPassword string `form:"new_password" json:"new_password,omitempty" binding:"required"` }
PasswordUpdate is the request body for updating a user's password
func (*PasswordUpdate) GetNewPassword ¶
func (pw *PasswordUpdate) GetNewPassword() string
GetNewPassword returns the user's new password which will replace the old password
func (*PasswordUpdate) GetOldPassword ¶
func (pw *PasswordUpdate) GetOldPassword() string
GetOldPassword returns the user's old password
type ProxyInfo ¶
type ProxyInfo struct {
// contains filtered or unexported fields
}
ProxyInfo is a container for establishing a reverse-proxy connection
func NewProxyInfo ¶
NewProxyInfo returns a new ProxyInfo container
func (*ProxyInfo) UpdateDirector ¶
UpdateDirector updates the endpoint in case of any change in the system
type ProxyStorage ¶
ProxyStorage maps the application name to its appropriate reverse-proxy container
func NewProxyStorage ¶
func NewProxyStorage() *ProxyStorage
NewProxyStorage returns a new ProxyStorage container
func (*ProxyStorage) Get ¶
func (ps *ProxyStorage) Get(key string) (*ProxyInfo, bool)
Get returns an application's reverse-proxy container along with a success message
func (*ProxyStorage) Update ¶
func (ps *ProxyStorage) Update(body map[string]string)
Update updates the application information in the ProxyStorage container
type RecordStorage ¶
type RecordStorage struct { sync.Mutex // Records are stored in the form of Key : Value pairs Holder map[string]string }
RecordStorage is the data structure for storing records
func NewRecordStorage ¶
func NewRecordStorage() *RecordStorage
NewRecordStorage returns a new instance of RecordStorage data structure
func (*RecordStorage) Get ¶
func (rs *RecordStorage) Get(key string) (string, bool)
Get retrieves a record from the storage
func (*RecordStorage) Replace ¶
func (rs *RecordStorage) Replace(replacement map[string]string)
Replace replaces the records in the storage with new records
func (*RecordStorage) Set ¶
func (rs *RecordStorage) Set(key, value string)
Set adds/updates a single record to the storage
func (*RecordStorage) SetBulk ¶
func (rs *RecordStorage) SetBulk(data map[string]string)
SetBulk adds/updates multiple records to the storage
type RepositoryRequest ¶
type RepositoryRequest struct {
Name string `` /* 288-byte string literal not displayed */
}
type RepositoryResponse ¶
type Resources ¶
type Resources struct { // Memory limits in GB Memory float64 `json:"memory" bson:"memory" valid:"float~Field 'memory' inside field 'resources' should be of type float"` // CPU quota in units of CPUs CPU float64 `json:"cpu" bson:"cpu" valid:"float~Field 'cpu' inside field 'resources' should be of type float"` }
Resources defines the resources requested by an application
type ResponseError ¶
ResponseError is a type for declaring response error from server
type Stats ¶
type Stats struct { Memory MemoryStats `json:"memory_stats"` CPU CPUStats `json:"cpu_stats"` }
Stats defines a struct for storing container statistics
type UpdateContext ¶
type UpdatePayload ¶
type UpdatePayload struct { Password *string `json:"password" bson:"password"` Git *UpdateGit `json:"git" bson:"git"` Context *UpdateContext `json:"context" bson:"context"` Resources *Resources `json:"resources,omitempty" bson:"resources,omitempty"` }
type User ¶
type User struct { Email string `` /* 127-byte string literal not displayed */ Password string `` /* 143-byte string literal not displayed */ Username string `` /* 347-byte string literal not displayed */ Admin bool `form:"admin" json:"admin" bson:"admin"` Success bool `json:"success,omitempty" bson:"-"` GctlUUID string `json:"gctl_uuid" bson:"gctl_uuid"` }
User stores user related information
func (*User) GetPassword ¶
GetPassword returns the user's password The password will be hashed if retrieving from database
func (*User) SetPassword ¶
SetPassword sets a password in the user's context
func (*User) SetSuccess ¶
SetSuccess defines the success of user creation