Documentation ¶
Index ¶
- Constants
- Variables
- type Address
- type App
- type AppListItem
- type AppOperations
- func (ops *AppOperations) CheckPermAndGet(user *database.User, appName string) (*App, error)
- func (ops *AppOperations) Create(user *database.User, app *App) (Err error)
- func (ops *AppOperations) Delete(user *database.User, appName string) error
- func (ops *AppOperations) Get(appName string) (*App, error)
- func (ops *AppOperations) HasPermission(user *database.User, appName string) bool
- func (ops *AppOperations) Info(user *database.User, appName string) (*Info, error)
- func (ops *AppOperations) List(user *database.User) ([]*AppListItem, error)
- func (ops *AppOperations) Logs(user *database.User, appName string, lines int64, follow bool) (io.ReadCloser, error)
- func (ops *AppOperations) SaveApp(app *App, lastUser string) error
- func (ops *AppOperations) SetAutoscale(user *database.User, appName string, as *Autoscale) error
- func (ops *AppOperations) SetEnv(user *database.User, appName string, evs []*EnvVar) error
- func (ops *AppOperations) TeamName(appName string) (string, error)
- func (ops *AppOperations) UnsetEnv(user *database.User, appName string, evNames []string) error
- type Autoscale
- type EnvVar
- type FakeOperations
- func (f *FakeOperations) CheckPermAndGet(user *database.User, appName string) (*App, error)
- func (f *FakeOperations) Create(user *database.User, app *App) error
- func (f *FakeOperations) Delete(user *database.User, appName string) error
- func (f *FakeOperations) Get(appName string) (*App, error)
- func (f *FakeOperations) HasPermission(user *database.User, appName string) bool
- func (f *FakeOperations) Info(user *database.User, appName string) (*Info, error)
- func (f *FakeOperations) List(user *database.User) ([]*AppListItem, error)
- func (f *FakeOperations) Logs(user *database.User, appName string, lines int64, follow bool) (io.ReadCloser, error)
- func (f *FakeOperations) SaveApp(app *App, lastUser string) error
- func (f *FakeOperations) SetAutoscale(user *database.User, appName string, as *Autoscale) error
- func (f *FakeOperations) SetEnv(user *database.User, appName string, envVars []*EnvVar) error
- func (f *FakeOperations) TeamName(appName string) (string, error)
- func (f *FakeOperations) UnsetEnv(user *database.User, appName string, envVars []string) error
- type Info
- type K8sOperations
- type LimitRangeQuantity
- type Limits
- type Operations
- type Pod
- type Service
- func (s *Service) Create(ctx context.Context, req *appb.CreateRequest) (*appb.Empty, error)
- func (s *Service) Delete(ctx context.Context, req *appb.DeleteRequest) (*appb.Empty, error)
- func (s *Service) Info(ctx context.Context, req *appb.InfoRequest) (*appb.InfoResponse, error)
- func (s *Service) List(ctx context.Context, _ *appb.Empty) (*appb.ListResponse, error)
- func (s *Service) Logs(req *appb.LogsRequest, stream appb.App_LogsServer) error
- func (s *Service) RegisterService(grpcServer *grpc.Server)
- func (s *Service) SetAutoscale(ctx context.Context, req *appb.SetAutoscaleRequest) (*appb.Empty, error)
- func (s *Service) SetEnv(ctx context.Context, req *appb.SetEnvRequest) (*appb.Empty, error)
- func (s *Service) UnsetEnv(ctx context.Context, req *appb.UnsetEnvRequest) (*appb.Empty, error)
- type Status
Constants ¶
View Source
const ( TeresaAnnotation = "teresa.io/app" TeresaTeamLabel = "teresa.io/team" TeresaLastUser = "teresa.io/last-user" )
View Source
const (
ProcessTypeWeb = "web"
)
Variables ¶
View Source
var ( ErrAlreadyExists = status.Errorf(codes.AlreadyExists, "App already exists") ErrNotFound = status.Errorf(codes.NotFound, "App not found") ErrProtectedEnvVar = status.Errorf(codes.InvalidArgument, "Can't change protected env vars") ErrInvalidLimits = status.Errorf(codes.InvalidArgument, "Invalid Limits") ErrInvalidAutoscale = status.Errorf(codes.InvalidArgument, "Invalid Autoscale") )
Functions ¶
This section is empty.
Types ¶
type AppListItem ¶
type AppOperations ¶
type AppOperations struct {
// contains filtered or unexported fields
}
func (*AppOperations) CheckPermAndGet ¶ added in v0.8.0
func (*AppOperations) Create ¶
func (ops *AppOperations) Create(user *database.User, app *App) (Err error)
func (*AppOperations) Delete ¶ added in v0.8.0
func (ops *AppOperations) Delete(user *database.User, appName string) error
func (*AppOperations) HasPermission ¶
func (ops *AppOperations) HasPermission(user *database.User, appName string) bool
func (*AppOperations) List ¶
func (ops *AppOperations) List(user *database.User) ([]*AppListItem, error)
func (*AppOperations) Logs ¶
func (ops *AppOperations) Logs(user *database.User, appName string, lines int64, follow bool) (io.ReadCloser, error)
func (*AppOperations) SaveApp ¶ added in v0.8.0
func (ops *AppOperations) SaveApp(app *App, lastUser string) error
func (*AppOperations) SetAutoscale ¶ added in v0.7.0
type FakeOperations ¶
func (*FakeOperations) CheckPermAndGet ¶ added in v0.8.0
func (*FakeOperations) Create ¶
func (f *FakeOperations) Create(user *database.User, app *App) error
func (*FakeOperations) Delete ¶ added in v0.8.0
func (f *FakeOperations) Delete(user *database.User, appName string) error
func (*FakeOperations) HasPermission ¶
func (f *FakeOperations) HasPermission(user *database.User, appName string) bool
func (*FakeOperations) List ¶
func (f *FakeOperations) List(user *database.User) ([]*AppListItem, error)
func (*FakeOperations) Logs ¶
func (f *FakeOperations) Logs(user *database.User, appName string, lines int64, follow bool) (io.ReadCloser, error)
func (*FakeOperations) SaveApp ¶ added in v0.8.0
func (f *FakeOperations) SaveApp(app *App, lastUser string) error
func (*FakeOperations) SetAutoscale ¶ added in v0.7.0
type K8sOperations ¶
type K8sOperations interface { NamespaceAnnotation(namespace, annotation string) (string, error) NamespaceLabel(namespace, label string) (string, error) PodList(namespace string) ([]*Pod, error) PodLogs(namespace, podName string, lines int64, follow bool) (io.ReadCloser, error) CreateNamespace(app *App, userEmail string) error CreateQuota(app *App) error CreateSecret(appName, secretName string, data map[string][]byte) error CreateOrUpdateAutoscale(app *App) error AddressList(namespace string) ([]*Address, error) Status(namespace string) (*Status, error) Autoscale(namespace string) (*Autoscale, error) Limits(namespace, name string) (*Limits, error) IsNotFound(err error) bool IsAlreadyExists(err error) bool SetNamespaceAnnotations(namespace string, annotations map[string]string) error DeleteDeployEnvVars(namespace, name string, evNames []string) error CreateOrUpdateDeployEnvVars(namespace, name string, evs []*EnvVar) error DeleteNamespace(namespace string) error NamespaceListByLabel(label, value string) ([]string, error) }
type LimitRangeQuantity ¶
type Limits ¶
type Limits struct { Default []*LimitRangeQuantity DefaultRequest []*LimitRangeQuantity }
type Operations ¶
type Operations interface { Create(user *database.User, app *App) error Logs(user *database.User, appName string, lines int64, follow bool) (io.ReadCloser, error) Info(user *database.User, appName string) (*Info, error) TeamName(appName string) (string, error) Get(appName string) (*App, error) HasPermission(user *database.User, appName string) bool SetEnv(user *database.User, appName string, evs []*EnvVar) error UnsetEnv(user *database.User, appName string, evs []string) error List(user *database.User) ([]*AppListItem, error) SetAutoscale(user *database.User, appName string, as *Autoscale) error CheckPermAndGet(user *database.User, appName string) (*App, error) SaveApp(app *App, lastUser string) error Delete(user *database.User, appName string) error }
func NewFakeOperations ¶
func NewFakeOperations() Operations
func NewOperations ¶
func NewOperations(tops team.Operations, kops K8sOperations, st st.Storage) Operations
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(ops Operations) *Service
func (*Service) Info ¶
func (s *Service) Info(ctx context.Context, req *appb.InfoRequest) (*appb.InfoResponse, error)
func (*Service) Logs ¶
func (s *Service) Logs(req *appb.LogsRequest, stream appb.App_LogsServer) error
func (*Service) RegisterService ¶
func (*Service) SetAutoscale ¶ added in v0.7.0
Click to show internal directories.
Click to hide internal directories.