module

package
v0.0.0-...-3794c23 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrivateModule = "PRIVATE"
	PublicModule  = "PUBLIC"
)

Variables

This section is empty.

Functions

func NewEchohandler

func NewEchohandler(e *echo.Echo, logger *zap.Logger, moduleUseCase ModuleUseCase)

Types

type EchoHandler

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

func (EchoHandler) Create

func (h EchoHandler) Create(c echo.Context) error

func (EchoHandler) Delete

func (h EchoHandler) Delete(c echo.Context) error

func (EchoHandler) FindAll

func (h EchoHandler) FindAll(c echo.Context) error

func (EchoHandler) FindById

func (h EchoHandler) FindById(c echo.Context) error

func (EchoHandler) Update

func (h EchoHandler) Update(c echo.Context) error

type Module

type Module struct {
	Name       string `json:"name" validate:"required"`
	Visibility string `json:"visibility" validate:"required,oneof=PRIVATE PUBLIC"`
	charlescdiov1alpha1.ModuleSpec
	Auth *ModuleAuth `json:"auth"`
}

type ModuleAuth

type ModuleAuth struct {
	AuthType      string `json:"type,omitempty" validate:"oneof=HTTPS SSH ACCESS_TOKEN"`
	SshPrivateKey string `json:"sshPrivateKey,omitempty"`
	Username      string `json:"username,omitempty"`
	Password      string `json:"password,omitempty"`
	AccessToken   string `json:"accessToken,omitempty"`
}

type ModuleModel

type ModuleModel struct {
	ID        string `json:"id"`
	CreatedAt string `json:"createdAt"`
	Module
}

type ModuleRepository

type ModuleRepository interface {
	FindAll(ctx context.Context, namespace string, listoptions listoptions.Request) (listoptions.Response, error)
	FindById(ctx context.Context, namespace string, moduleId string) (ModuleModel, error)
	Create(ctx context.Context, namespace string, module Module) (ModuleModel, error)
	Update(ctx context.Context, namespace string, moduleId string, module Module) (ModuleModel, error)
	Delete(ctx context.Context, namespace string, moduleId string) error
}

func NewK8sRepository

func NewK8sRepository(clientset client.Client) ModuleRepository

type ModuleUseCase

type ModuleUseCase interface {
	FindAll(ctx context.Context, workspaceId string, listoptions listoptions.Request) (listoptions.Response, error)
	FindById(ctx context.Context, workspaceId string, moduleId string) (ModuleModel, error)
	Create(ctx context.Context, workspaceId string, module Module) (ModuleModel, error)
	Update(ctx context.Context, workspaceId string, moduleId string, module Module) (ModuleModel, error)
	Delete(ctx context.Context, workspaceId string, moduleId string) error
}

func NewUseCase

func NewUseCase(workspaceUseCase workspace.WorkspaceUseCase, moduleRepository ModuleRepository) ModuleUseCase

type UseCase

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

func (UseCase) Create

func (u UseCase) Create(ctx context.Context, workspaceId string, module Module) (ModuleModel, error)

Create implements ModuleUseCase

func (UseCase) Delete

func (u UseCase) Delete(ctx context.Context, workspaceId string, moduleId string) error

Delete implements ModuleUseCase

func (UseCase) FindAll

func (u UseCase) FindAll(ctx context.Context, workspaceId string, options listoptions.Request) (listoptions.Response, error)

FindAll implements ModuleUseCase

func (UseCase) FindById

func (u UseCase) FindById(ctx context.Context, workspaceId string, moduleId string) (ModuleModel, error)

FindByName implements ModuleUseCase

func (UseCase) Update

func (u UseCase) Update(ctx context.Context, workspaceId string, name string, module Module) (ModuleModel, error)

Update implements ModuleUseCase

Jump to

Keyboard shortcuts

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