Documentation
¶
Index ¶
- Constants
- type CreateParam
- type Factory
- type ImportNotebookServersEvent
- type NotebookServer
- type Repository
- type Runtime
- type Service
- type Settings
- type Status
- type UnimplementedRuntime
- func (UnimplementedRuntime) Create(context.Context, *NotebookServer) error
- func (UnimplementedRuntime) Delete(context.Context, *NotebookServer) error
- func (UnimplementedRuntime) GetStatus(context.Context, *NotebookServer) (*Status, error)
- func (UnimplementedRuntime) Start(context.Context, *NotebookServer) error
- func (UnimplementedRuntime) Stop(context.Context, *NotebookServer) error
- type Volume
Constants ¶
View Source
const ( ServerStatusTerminated = "Terminated" ServerStatusTerminating = "Terminating" ServerStatusPending = "Pending" ServerStatusRunning = "Running" ServerStatusUnknown = "Unknown" )
View Source
const ( VolumeTypeNFS = "NFS" VolumeTypeTOS = "TOS" // not support VolumeTypeS3 = "S3" // not support )
View Source
const (
ImportNotebookServers = "ImportNotebookServers"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateParam ¶
type CreateParam struct {
WorkspaceID string
Image string
ResourceSize notebook.ResourceSize
Volumes []Volume
}
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
func NewFactory ¶
func NewFactory(officialImages []string, sizeOptions []notebook.ResourceOption) *Factory
func (*Factory) GetResourceSizes ¶
func (f *Factory) GetResourceSizes() []notebook.ResourceSize
func (*Factory) New ¶
func (f *Factory) New(param *CreateParam) (*NotebookServer, error)
type ImportNotebookServersEvent ¶
type ImportNotebookServersEvent struct {
WorkspaceID string
Schema schema.NotebookTypedSchema
ImportFileBaseDir string
}
func NewImportNotebookServersEvent ¶
func NewImportNotebookServersEvent(workspaceID, baseDir string, schema schema.NotebookTypedSchema) *ImportNotebookServersEvent
func NewImportNotebookServersEventFromPayload ¶
func NewImportNotebookServersEventFromPayload(data []byte) (*ImportNotebookServersEvent, error)
func (*ImportNotebookServersEvent) Delay ¶
func (e *ImportNotebookServersEvent) Delay() time.Duration
func (*ImportNotebookServersEvent) EventType ¶
func (e *ImportNotebookServersEvent) EventType() string
func (*ImportNotebookServersEvent) Payload ¶
func (e *ImportNotebookServersEvent) Payload() []byte
type NotebookServer ¶
type Repository ¶
type Repository interface {
Save(context.Context, *NotebookServer) error
Get(context.Context, string) (*NotebookServer, error)
Delete(context.Context, *NotebookServer) error
}
Repository ...
type Runtime ¶
type Runtime interface {
Create(context.Context, *NotebookServer) error
Start(context.Context, *NotebookServer) error
Stop(context.Context, *NotebookServer) error
Delete(context.Context, *NotebookServer) error
GetStatus(context.Context, *NotebookServer) (*Status, error)
}
type Service ¶
type Service interface {
Create(context.Context, *NotebookServer) error
Update(context.Context, *NotebookServer) error
Start(ctx context.Context, id string) error
Stop(ctx context.Context, id string) error
Delete(ctx context.Context, id string) error
}
func NewService ¶
func NewService(repo Repository, runtime Runtime) Service
type Settings ¶
type Settings struct {
DockerImage string
ResourceSize notebook.ResourceSize
NodeSelector map[string]string // no need to persistence
}
type UnimplementedRuntime ¶
type UnimplementedRuntime struct{}
func (UnimplementedRuntime) Create ¶
func (UnimplementedRuntime) Create(context.Context, *NotebookServer) error
func (UnimplementedRuntime) Delete ¶
func (UnimplementedRuntime) Delete(context.Context, *NotebookServer) error
func (UnimplementedRuntime) GetStatus ¶
func (UnimplementedRuntime) GetStatus(context.Context, *NotebookServer) (*Status, error)
func (UnimplementedRuntime) Start ¶
func (UnimplementedRuntime) Start(context.Context, *NotebookServer) error
func (UnimplementedRuntime) Stop ¶
func (UnimplementedRuntime) Stop(context.Context, *NotebookServer) error
Click to show internal directories.
Click to hide internal directories.