jupyterhub

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Any ...
	Any = `(\S+)`
)

Variables

View Source
var (
	// ErrorParamsMistake ...
	ErrorParamsMistake = &Error{http.StatusBadRequest, "request params wrong"}
	// ErrorConflict ...
	ErrorConflict = &Error{http.StatusConflict, "object already exist"}
	// ErrorNotFound ...
	ErrorNotFound = &Error{http.StatusNotFound, "object not found"}
)

Functions

This section is empty.

Types

type API

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

API ...

func NewAPI

func NewAPI(hubAddress, adminToken string, hc *http.Client) *API

NewAPI ...

func (*API) CreateUser

func (api *API) CreateUser(ctx context.Context, username string) error

CreateUser create a non-admin user into jupyterhub

func (*API) DeleteServer

func (api *API) DeleteServer(ctx context.Context, user, servername string) error

DeleteServer ...

func (*API) DeleteUser

func (api *API) DeleteUser(ctx context.Context, user string) error

DeleteUser ...

func (*API) GetUser

func (api *API) GetUser(ctx context.Context, user string) (*User, error)

GetUser ...

func (*API) ListUsers

func (api *API) ListUsers(ctx context.Context) ([]User, error)

ListUsers ...

func (*API) Ping

func (api *API) Ping(ctx context.Context) error

Ping just test connection and authentication GetInfo

func (*API) StartServer

func (api *API) StartServer(ctx context.Context, user, servername string, options interface{}) error

StartServer ...

func (*API) StopServer

func (api *API) StopServer(ctx context.Context, user, servername string) error

StopServer ...

type Call

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

Call ...

func (*Call) Return

func (c *Call) Return(code int, a ...interface{})

Return ...

func (*Call) Success

func (c *Call) Success(a ...interface{})

Success ...

type Error

type Error struct {
	Status  int
	Message string
}

Error ...

func (*Error) Error

func (e *Error) Error() string

Error ...

type Mock

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

Mock ...

func NewJupyterHubMock

func NewJupyterHubMock(hubAddress string, hc *http.Client) *Mock

NewJupyterHubMock hubAddress must be same witch API.addr

func (*Mock) Close

func (m *Mock) Close()

Close call it when test finish

func (*Mock) CreateAPIToken

func (m *Mock) CreateAPIToken(username string) *Call

CreateAPIToken ...

func (*Mock) CreateUser

func (m *Mock) CreateUser(username string) *Call

CreateUser ...

func (*Mock) DeleteServer

func (m *Mock) DeleteServer(username, servername string) *Call

DeleteServer ...

func (*Mock) DeleteUser

func (m *Mock) DeleteUser(username string) *Call

DeleteUser ...

func (*Mock) GetUser

func (m *Mock) GetUser(username string) *Call

GetUser ...

func (*Mock) ListUsers

func (m *Mock) ListUsers() *Call

ListUsers ...

func (*Mock) Ping

func (m *Mock) Ping() *Call

Ping ...

func (*Mock) Reset

func (m *Mock) Reset()

Reset ...

func (*Mock) StartServer

func (m *Mock) StartServer(username, servername string, options ...interface{}) *Call

StartServer ...

func (*Mock) StopServer

func (m *Mock) StopServer(username, servername string) *Call

StopServer ...

type Server

type Server struct {
	Name             string    `json:"name"`
	Ready            bool      `json:"ready"`
	Pending          *string   `json:"pending"`
	Stopped          bool      `json:"stopped"`
	URL              string    `json:"url"`
	LastActivityTime time.Time `json:"last_activity"`
	ProgressURL      string    `json:"progress_url"`
	StartTime        time.Time `json:"started"`
}

Server ...

type User

type User struct {
	Name    string
	Admin   bool
	Created time.Time
	Servers map[string]Server
}

User ...

Jump to

Keyboard shortcuts

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