Documentation ¶
Index ¶
- Constants
- func ParseJWT(tokenStr string) (string, error)
- func SignJWT(userName string) (string, error)
- type AppService
- func (svc *AppService) Create(ctx context.Context, projectName string, reqData *requests.CreateApp) error
- func (svc *AppService) List(ctx context.Context, projectName string) (*responses.ListApp, error)
- func (svc *AppService) Restart(ctx context.Context, projectName, appName string) error
- func (svc *AppService) Update(ctx context.Context, projectName, appName string, reqData *requests.UpdateApp) error
- type AppSvc
- type K8sService
- type K8sSvc
- type ProjectService
- func (svc *ProjectService) Create(ctx context.Context, userName string, reqData *requests.CreateProject) error
- func (svc *ProjectService) Get(ctx context.Context, userName, projectName string) (*responses.Project, error)
- func (svc *ProjectService) List(ctx context.Context, userName string) (*responses.ListProject, error)
- type ProjectSvc
- type UserService
- func (svc *UserService) Create(ctx context.Context, reqData *requests.CreateUser) error
- func (svc *UserService) HasRole(ctx context.Context, userName, role string) (bool, error)
- func (svc *UserService) List(ctx context.Context) (*responses.ListUser, error)
- func (svc *UserService) Login(ctx context.Context, userName, password string) (string, error)
- type UserSvc
Constants ¶
View Source
const ( UserRoleRegular string = "regular" UserRoleAdmin string = "admin" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AppService ¶
type AppService struct {
// contains filtered or unexported fields
}
func NewAppService ¶
func NewAppService(k8sSvc K8sSvc) *AppService
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 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) List ¶
func (svc *ProjectService) List(ctx context.Context, userName string) (*responses.ListProject, error)
type ProjectSvc ¶
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
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
Click to show internal directories.
Click to hide internal directories.