Documentation
¶
Overview ¶
Code generated by jsonrpc2. DO NOT EDIT.
Index ¶
- type API
- type File
- type Server
- func (srv *Server) Handler(ctx context.Context, project *application.Project, templatesDir string, ...) (http.Handler, error)
- func (srv *Server) Login(login, password string) (*Token, error)
- func (srv *Server) Save() error
- func (srv *Server) SetPassword(password string)
- func (srv *Server) ValidateToken(ctx context.Context, token *Token) error
- type Template
- type TemplateStatus
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
// Login user by username and password. Returns signed JWT
Login(ctx context.Context, login, password string) (*Token, error)
// Change password for the user
ChangePassword(ctx context.Context, token *Token, password string) (bool, error)
// Create new app (lambda)
Create(ctx context.Context, token *Token) (*application.App, error)
// Project configuration
Config(ctx context.Context, token *Token) (*application.ProjectConfig, error)
// Apply new configuration and save it
Apply(ctx context.Context, token *Token, config application.ProjectConfig) (bool, error)
// Get all templates without filtering
AllTemplates(ctx context.Context, token *Token) ([]*TemplateStatus, error)
// Create new app/lambda/function using pre-defined template
CreateFromTemplate(ctx context.Context, token *Token, templateName string) (*application.App, error)
// Upload content from .tar.gz archive to app and call Install handler (if defined)
Upload(ctx context.Context, token *Token, uid string, tarGz []byte) (bool, error)
// Download content as .tar.gz archive from app
Download(ctx context.Context, token *Token, uid string) ([]byte, error)
// Push single file to app
Push(ctx context.Context, token *Token, uid string, file string, content []byte) (bool, error)
// Pull single file from app
Pull(ctx context.Context, token *Token, uid string, file string) ([]byte, error)
// List available apps (lambdas) in a project
List(ctx context.Context, token *Token) ([]*application.App, error)
// Remove app and call Uninstall handler (if defined)
Remove(ctx context.Context, token *Token, uid string) (bool, error)
// Templates with filter by availability including embedded
Templates(ctx context.Context, token *Token) ([]*Template, error)
// Files in func dir
Files(ctx context.Context, token *Token, name string, dir string) ([]*File, error)
// Info about application
Info(ctx context.Context, token *Token, uid string) (*application.App, error)
// Update application manifest
Update(ctx context.Context, token *Token, uid string, manifest types.Manifest) (*application.App, error)
// Create file or directory inside app
CreateFile(ctx context.Context, token *Token, uid string, path string, dir bool) (bool, error)
// Remove file or directory
RemoveFile(ctx context.Context, token *Token, uid string, path string) (bool, error)
// Rename file or directory
RenameFile(ctx context.Context, token *Token, uid string, oldPath, newPath string) (bool, error)
// Global last records
GlobalStats(ctx context.Context, token *Token, limit int) ([]stats.Record, error)
// Stats for the app
Stats(ctx context.Context, token *Token, uid string, limit int) ([]stats.Record, error)
// Actions available for the app
Actions(ctx context.Context, token *Token, uid string) ([]string, error)
// Invoke action in the app (if make installed)
Invoke(ctx context.Context, token *Token, uid string, action string) (bool, error)
}
type Server ¶
type Server struct {
Admin string `json:"admin"` // login for admin authorization
Salt string `json:"salt"` // password salt
Hash []byte `json:"hash"` // password hash
Secret string `json:"secret"` // secret for JWT
LifeTime time.Duration `json:"life_time"` // life time for JWT
// contains filtered or unexported fields
}
func (*Server) SetPassword ¶
type TemplateStatus ¶
type Token ¶
type Token struct {
Login string `json:"-"` // parsed by validator
Data string `json:"-"` // raw JWT
}
JWT wrapper , should be unmarshalled from string
func (*Token) MarshalJSON ¶
func (*Token) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.