soapboxd

package
v0.0.0-...-1834baf Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package soapboxd provides server-side implementation of the services defined in the proto package for Soapbox application, deployment, environment, etc. related services.

Index

Constants

View Source
const SoapboxImageBucket = "soapbox-app-images"

SoapboxImageBucket is the location within the blob store to hold build images

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Name          string
	Slug          string
	GithubRepoURL string
	Committish    string
}

Application is a minimal version of the information about an app on the platform

type CloudProvider

type CloudProvider interface {
	ObjectStore
	ConfigurationStore
	Deployer
}

CloudProvider is a summation type of all the interfaces that a cloud must provide

type ConfigurationStore

type ConfigurationStore interface {
	GetConfigVars(appSlug string, envSlug string, version int32) ([]*pb.ConfigVar, error)
	SaveConfigVars(appSlug string, envSlug string, version int32, configVars []*pb.ConfigVar, kmsKeyARN string) error
	DeleteConfigVars(appSlug string, envSlug string, version int32) error
}

ConfigurationStore represents a place that can store and retrieve configurations for applications

type Deployer

type Deployer interface {
	Deploy(app Application, env Environment, config *pb.Configuration) error // Deploy is defined by the trio of application, environment, and configuration
	Rollforward(app Application, env Environment) error                      // Finalize a successful deployment
	Cleanup(app Application, env Environment)                                // Clean any remaining resources (e.g., Blue group) from either a failed or successful deployment
}

Deployer represents something that can blue/green deploy an image to a cloud provider

type Environment

type Environment struct {
	ID   int32
	Name string
	Slug string
}

Environment is a minimal version of the information about an environment into which an application can be deployed

type ObjectStore

type ObjectStore interface {
	UploadFile(bucket string, key string, filename string) error
}

ObjectStore represents a blob store that can hold arbitrary files

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is the basic soapbox server containing all the initialized items needed to perform its functions

func NewServer

func NewServer(db *sql.DB, httpClient *http.Client, cloud CloudProvider) *Server

NewServer creates an new instance of the server object

func (*Server) AddActivity

func (s *Server) AddActivity(ctx context.Context, activity *pb.Activity) (*pb.Empty, error)

func (*Server) AddApplicationActivity

func (s *Server) AddApplicationActivity(ctx context.Context, applicationID int32, userID int32, activityType models.ActivityType) error

func (*Server) AddCreateEnvironmentActivity

func (s *Server) AddCreateEnvironmentActivity(ctx context.Context, env *pb.Environment) error

func (*Server) AddDeploymentActivity

func (s *Server) AddDeploymentActivity(ctx context.Context, activityType pb.ActivityType, dep *pb.Deployment) error

func (*Server) AssignGithubOmniauthTokenToUser

func (s *Server) AssignGithubOmniauthTokenToUser(ctx context.Context, user *pb.User) (*pb.User, error)

func (*Server) CreateApplication

func (s *Server) CreateApplication(ctx context.Context, app *pb.Application) (*pb.Application, error)

func (*Server) CreateConfiguration

func (s *Server) CreateConfiguration(ctx context.Context, req *proto.CreateConfigurationRequest) (*proto.Configuration, error)

func (*Server) CreateEnvironment

func (s *Server) CreateEnvironment(ctx context.Context, req *pb.Environment) (*pb.Environment, error)

func (*Server) CreateUser

func (s *Server) CreateUser(ctx context.Context, user *pb.CreateUserRequest) (*pb.User, error)

func (*Server) DeleteApplication

func (s *Server) DeleteApplication(ctx context.Context, app *pb.Application) (*pb.Empty, error)

func (*Server) DeleteConfiguration

func (s *Server) DeleteConfiguration(ctx context.Context, req *proto.DeleteConfigurationRequest) (*proto.Empty, error)

func (*Server) DestroyEnvironment

func (s *Server) DestroyEnvironment(ctx context.Context, req *pb.DestroyEnvironmentRequest) (*pb.Empty, error)

func (*Server) GetApplication

func (s *Server) GetApplication(ctx context.Context, req *pb.GetApplicationRequest) (*pb.Application, error)

func (*Server) GetApplicationMetrics

func (s *Server) GetApplicationMetrics(ctx context.Context, req *pb.GetApplicationMetricsRequest) (*pb.ApplicationMetricsResponse, error)

func (*Server) GetDeployment

func (s *Server) GetDeployment(ctx context.Context, req *pb.GetDeploymentRequest) (*pb.Deployment, error)

func (*Server) GetDeploymentStatus

func (*Server) GetEnvironment

func (s *Server) GetEnvironment(ctx context.Context, req *pb.GetEnvironmentRequest) (*pb.Environment, error)

func (*Server) GetLatestConfiguration

func (s *Server) GetLatestConfiguration(ctx context.Context, req *proto.GetLatestConfigurationRequest) (*proto.Configuration, error)

func (*Server) GetLatestDeployment

func (s *Server) GetLatestDeployment(ctx context.Context, req *pb.GetLatestDeploymentRequest) (*pb.Deployment, error)

GetLatestDeployment gets latest deployment for an application environment.

func (*Server) GetUser

func (s *Server) GetUser(ctx context.Context, req *pb.GetUserRequest) (*pb.User, error)

func (*Server) GetVersion

func (s *Server) GetVersion(ctx context.Context, req *pb.Empty) (*pb.GetVersionResponse, error)

func (*Server) ListActivities

func (s *Server) ListActivities(ctx context.Context, _ *pb.Empty) (*pb.ListActivitiesResponse, error)

func (*Server) ListApplicationActivities

func (s *Server) ListApplicationActivities(ctx context.Context, app *pb.GetApplicationRequest) (*pb.ListActivitiesResponse, error)

func (*Server) ListApplications

func (s *Server) ListApplications(ctx context.Context, req *pb.ListApplicationRequest) (*pb.ListApplicationResponse, error)

func (*Server) ListConfigurations

func (*Server) ListDeploymentActivities

func (s *Server) ListDeploymentActivities(ctx context.Context, app *pb.GetDeploymentRequest) (*pb.ListActivitiesResponse, error)

func (*Server) ListDeployments

func (s *Server) ListDeployments(ctx context.Context, req *pb.ListDeploymentRequest) (*pb.ListDeploymentResponse, error)

func (*Server) ListEnvironments

func (s *Server) ListEnvironments(ctx context.Context, req *pb.ListEnvironmentRequest) (*pb.ListEnvironmentResponse, error)

func (*Server) LoginUser

func (s *Server) LoginUser(ctx context.Context, req *pb.LoginUserRequest) (*pb.LoginUserResponse, error)

func (*Server) StartDeployment

func (s *Server) StartDeployment(ctx context.Context, req *pb.Deployment) (*pb.StartDeploymentResponse, error)

func (*Server) TeardownDeployment

func (s *Server) TeardownDeployment(ctx context.Context, req *pb.TeardownDeploymentRequest) (*pb.Empty, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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