services

package
v0.0.0-...-b1f728d Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserRoleRegular string = "regular"
	UserRoleAdmin   string = "admin"
)

Variables

This section is empty.

Functions

func ParseJWT

func ParseJWT(tokenStr string) (string, error)

ParseJWT parses a jwt token

func SignJWT

func SignJWT(userName string) (string, error)

SignJWT returns a jwt signed token

Types

type AppService

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

func NewAppService

func NewAppService(k8sSvc K8sSvc) *AppService

func (*AppService) Create

func (svc *AppService) Create(ctx context.Context, projectName string, reqData *requests.CreateApp) error

func (*AppService) List

func (svc *AppService) List(ctx context.Context, projectName string) (*responses.ListApp, error)

func (*AppService) Restart

func (svc *AppService) Restart(ctx context.Context, projectName, appName string) error

func (*AppService) Update

func (svc *AppService) Update(ctx context.Context, projectName, appName string, reqData *requests.UpdateApp) error

type AppSvc

type AppSvc interface {
	Create(ctx context.Context, projectName string, reqData *requests.CreateApp) error
	Update(ctx context.Context, projectName, appName string, reqData *requests.UpdateApp) error
	List(ctx context.Context, projectName string) (*responses.ListApp, error)
	Restart(ctx context.Context, projectName, appName string) error
}

type K8sService

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

func NewK8sService

func NewK8sService() (*K8sService, error)

func (*K8sService) Client

func (svc *K8sService) Client() client.Client

type K8sSvc

type K8sSvc interface {
	Client() client.Client
}

type ProjectService

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

func NewProjectService

func NewProjectService(k8sSvc K8sSvc) *ProjectService

func (*ProjectService) Create

func (svc *ProjectService) Create(ctx context.Context, userName string, reqData *requests.CreateProject) error

func (*ProjectService) Get

func (svc *ProjectService) Get(ctx context.Context, userName, projectName string) (*responses.Project, error)

func (*ProjectService) List

func (svc *ProjectService) List(ctx context.Context, userName string) (*responses.ListProject, error)

type ProjectSvc

type ProjectSvc interface {
	Create(ctx context.Context, userName string, reqData *requests.CreateProject) error
	Get(ctx context.Context, userName, projectName string) (*responses.Project, error)
	List(ctx context.Context, userName string) (*responses.ListProject, error)
}

type UserService

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

func NewUserService

func NewUserService(k8sSvc K8sSvc) *UserService

NewUserService builds a new user service

func (*UserService) Create

func (svc *UserService) Create(ctx context.Context, reqData *requests.CreateUser) error

func (*UserService) HasRole

func (svc *UserService) HasRole(ctx context.Context, userName, role string) (bool, error)

func (*UserService) List

func (svc *UserService) List(ctx context.Context) (*responses.ListUser, error)

func (*UserService) Login

func (svc *UserService) Login(ctx context.Context, userName, password string) (string, error)

type UserSvc

type UserSvc interface {
	Login(ctx context.Context, userName, password string) (string, error)
	Create(ctx context.Context, reqData *requests.CreateUser) error
	HasRole(ctx context.Context, userName, role string) (bool, error)
	List(ctx context.Context) (*responses.ListUser, error)
}

UserSvc interface

Jump to

Keyboard shortcuts

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