resources

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const PersonalAccessTokenLength = 128

PersonalAccessTokenLength is used to create and validate personal access tokens

Variables

This section is empty.

Functions

func CreateAccessToken

func CreateAccessToken(db *gorm.DB, token *AccessToken) (bool, error)

CreateAccessToken will add a new AccessToken to Brizo.

func CreateApplication

func CreateApplication(db *gorm.DB, app *Application) (bool, error)

CreateApplication will add a new Application to Brizo

func CreateEnvironment

func CreateEnvironment(db *gorm.DB, client kube.APIInterface, environment *Environment, application *Application) (bool, error)

CreateEnvironment will add a new Environment to Brizo

func CreateEnvironmentConfig

func CreateEnvironmentConfig(db *gorm.DB, config *EnvironmentConfig) (bool, error)

CreateEnvironmentConfig will persist a new configuration into database

func CreateVersion

func CreateVersion(db *gorm.DB, client kube.APIInterface, version *Version) (bool, error)

CreateVersion will create and deploy a new version

func DeleteApplication

func DeleteApplication(db *gorm.DB, name string) (bool, error)

DeleteApplication will delete an existing Application by name

func DeleteEnvironment

func DeleteEnvironment(db *gorm.DB, name string) (bool, error)

DeleteEnvironment will delete an existing Environment by name

func DeleteEnvironmentConfig

func DeleteEnvironmentConfig(db *gorm.DB, uuid string) (bool, error)

DeleteEnvironmentConfig will delete specified configuration

func DeleteVersion

func DeleteVersion(db *gorm.DB, name string) (bool, error)

DeleteVersion will delete an existing Version by name

func DeployVersion added in v0.1.2

func DeployVersion(client kube.APIInterface, version *Version) (bool, error)

DeployVersion will deploy an existing version

func GetEnvironmentConfig

func GetEnvironmentConfig(db *gorm.DB, uuid string) (*[]EnvironmentConfig, error)

GetEnvironmentConfig will return the configuation values for specified environment UUID

func GetVersionsByEnvironmentUUID

func GetVersionsByEnvironmentUUID(db *gorm.DB, uuid string) (*[]Version, error)

GetVersionsByEnvironmentUUID will get an existing version using an environment's UUID

func HasAccessToken

func HasAccessToken(db *gorm.DB, token string) bool

HasAccessToken will return the existance of an access token in the database. Errors that occur on the passed db instance will not be returned, so the caller should check for any errors if desired.

func UpdateApplication

func UpdateApplication(db *gorm.DB, app *Application) (bool, error)

UpdateApplication will update an existing Application

func UpdateEnvironment

func UpdateEnvironment(db *gorm.DB, environment *Environment) (bool, error)

UpdateEnvironment will update an existing Environment

func UpdateEnvironmentService

func UpdateEnvironmentService(db *gorm.DB, client kube.APIInterface, environment *Environment, ports []ContainerPort) (bool, error)

UpdateEnvironmentService will update an existing Environment's service in K8s

func UpdateVersion

func UpdateVersion(db *gorm.DB, version *Version) (bool, error)

UpdateVersion will update an existing Version

Types

type AccessToken

type AccessToken struct {
	database.Model
	Token string `gorm:"not null;unique_index" sql:"type:varchar(128)" json:"token"`
}

AccessToken as defined by Brizo.

func AllAccessTokens added in v0.1.1

func AllAccessTokens(db *gorm.DB) ([]AccessToken, error)

AllAccessTokens will get existing access tokens

func CreateRandomAccessToken

func CreateRandomAccessToken(db *gorm.DB) (*AccessToken, error)

CreateRandomAccessToken will create a new AccessToken without requiring a pepared access token instance.

func GetAccessToken

func GetAccessToken(db *gorm.DB, token string) (*AccessToken, error)

GetAccessToken will get an existing access token by it's token string

func (*AccessToken) BeforeCreate

func (a *AccessToken) BeforeCreate() (err error)

BeforeCreate is a hook that runs before inserting a new record into the database

type Application

type Application struct {
	database.Model
	UUID         string        `gorm:"not null;unique_index" sql:"type:varchar(36)" json:"uuid"`
	Name         string        `gorm:"not null;unique_index" json:"name"`
	Slug         string        `gorm:"not null;unique_index" json:"slug"`
	Environments []Environment `json:"environments,array"`
}

Application as defined by Brizo.

func AllApplications

func AllApplications(db *gorm.DB) ([]Application, error)

AllApplications will return all of the Applications

func GetApplication

func GetApplication(db *gorm.DB, client kube.APIInterface, id string) (*Application, error)

GetApplication will get an existing Application by uuid

func GetApplicationByID

func GetApplicationByID(db *gorm.DB, id string) (*Application, error)

GetApplicationByID will get an existing Application by id

func GetApplicationByName added in v0.1.5

func GetApplicationByName(db *gorm.DB, name string) (*Application, error)

GetApplicationByName will get an existing Application by name

func (*Application) BeforeCreate

func (a *Application) BeforeCreate() (err error)

BeforeCreate is a hook that runs before inserting a new record into the database

type Container

type Container struct {
	Name         string                 `json:"name"`
	Image        string                 `json:"image"`
	AlwaysPull   bool                   `json:"alwaysPull"`
	Args         []string               `json:"args"`
	VolumeMounts []ContainerVolumeMount `json:"volumeMounts"`
	Ports        []ContainerPort        `json:"ports"`
}

Container individual container for a version

type ContainerPort

type ContainerPort struct {
	Protocol string `json:"protocol"`
	Port     int    `json:"port"`
}

ContainerPort exposed container port

type ContainerVolumeMount

type ContainerVolumeMount struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

ContainerVolumeMount mount configuration for an available volume

type Environment

type Environment struct {
	database.Model
	UUID            string      `gorm:"not null;unique_index" sql:"type:varchar(36)" json:"uuid"`
	Name            string      `gorm:"not null" json:"name"`
	Slug            string      `gorm:"not null" json:"slug"`
	VersionID       uint64      `gorm:"not null" json:"version_id,string"`
	VersionUUID     string      `gorm:"not null" json:"version_uuid"`
	Version         Version     `json:"version"`
	ApplicationID   uint64      `gorm:"not null" json:"application_id,string"`
	ApplicationUUID string      `gorm:"not null" json:"application_uuid"`
	Application     Application `json:"application"`
}

Environment as defined by Brizo.

func AllEnvironments

func AllEnvironments(db *gorm.DB) ([]Environment, error)

AllEnvironments will return all of the Environments

func GetEnvironment

func GetEnvironment(db *gorm.DB, id string) (*Environment, error)

GetEnvironment will get an existing Environment by id

func (*Environment) BeforeCreate

func (environment *Environment) BeforeCreate() (err error)

BeforeCreate is a hook that runs before inserting a new record into the database

type EnvironmentConfig

type EnvironmentConfig struct {
	database.Model
	UUID            string      `gorm:"not null;unique_index" sql:"type:varchar(36)" json:"uuid"`
	Name            string      `gorm:"not null" json:"name"`
	Value           string      `gorm:"not null" json:"value"`
	EnvironmentUUID string      `gorm:"not null" json:"environment_uuid"`
	Environment     Environment `gorm:"not null" json:"environment"`
}

EnvironmentConfig as defined by Brizo.

func (*EnvironmentConfig) BeforeCreate added in v0.1.2

func (config *EnvironmentConfig) BeforeCreate() (err error)

BeforeCreate is a hook that runs before inserting a new record into the database

type Spec added in v0.1.2

type Spec struct {
	Name      string
	Labels    []string
	Namespace string
	// contains filtered or unexported fields
}

Spec k8s spec information

type Version

type Version struct {
	database.Model
	UUID            string       `gorm:"not null;unique_index:uix_versions_name_application_uuid" sql:"type:varchar(36)" json:"uuid"`
	Name            string       `gorm:"not null" json:"name"`
	Slug            string       `gorm:"not null" json:"slug"`
	Replicas        int          `gorm:"not null" sql:"DEFAULT:'0'" json:"replicas"`
	ApplicationID   uint64       `gorm:"not null" json:"appliction_id,string"`
	ApplicationUUID string       `gorm:"not null;unique_index:uix_versions_name_application_uuid" json:"application_uuid"`
	Application     Application  `json:"application"`
	EnvironmentID   uint         `gorm:"not null" json:"environment_id,string"`
	EnvironmentUUID string       `gorm:"not null" json:"environment_uuid"`
	Environment     *Environment `json:"environment"`
	Volumes         []Volume     `gorm:"-" json:"volumes"`
	Containers      []Container  `gorm:"-" json:"containers"`
	Spec            string       `gorm:"type:json" json:"-"`
	RawArguments    string       `gorm:"type:json" json:"-"`
}

Version as defined by Brizo.

func AllVersions

func AllVersions(db *gorm.DB) ([]Version, error)

AllVersions will return all of the Versions

func GetVersion

func GetVersion(db *gorm.DB, id string, client *kube.Client, includeContainers bool) (*Version, error)

GetVersion will get an existing Version by id

func (*Version) BeforeCreate

func (version *Version) BeforeCreate() (err error)

BeforeCreate is a hook that runs before inserting a new record into the database

type Volume

type Volume struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

Volume as defined by Brizo.

Jump to

Keyboard shortcuts

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