server

package
v0.0.0-...-9bec60d Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeOK int = iota
	CodeErr
	CodeInvalidParams
	CodeDBExecutionError
	CodeLoginNotConfigured
	CodeLoginNoSuchAccount
	CodeLoginWrongPassword
	CodeNoSuchId
	CodeNoSuchServer
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteUploadRequest

type DeleteUploadRequest struct {
	ID uint64 `json:"id"`
}

type GetUploadsRequest

type GetUploadsRequest struct {
	Deleted      *bool  `url:"deleted"`
	GroupPattern string `url:"group"`
	Page         int64  `url:"page"`
	PageSize     int64  `url:"page_size"`
}

type GetUploadsResponse

type GetUploadsResponse struct {
	Items   []UploadDTO `json:"items"`
	Count   int64       `json:"count"`
	Current int64       `json:"current"`
}

type LoginRequest

type LoginRequest struct {
	Account  string `json:"account"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Code      int           `json:"code"`
	Message   string        `json:"message"`
	Token     string        `json:"token"`
	ExpiresIn time.Duration `json:"expires_in"`
}

type PingResponse

type PingResponse struct {
	Version string `json:"version"`
	Message string `json:"message"`
}

type Server

type Server struct {
	Logger *log.Logger
	S      suppress.ISuppress
	DB     *gorm.DB
	Config *ali_notifier.BackendConfig
}

func (*Server) DeleteUpload

func (srv *Server) DeleteUpload(ctx *context.Context)

func (*Server) ExposeHttp

func (srv *Server) ExposeHttp(r *iris.Application)

func (*Server) GetUploadList

func (srv *Server) GetUploadList(ctx *context.Context)

func (*Server) JwtHandler

func (*Server) Login

func (srv *Server) Login(ctx *context.Context)

func (*Server) ReadJSON

func (srv *Server) ReadJSON(ctx *context.Context, req interface{}) bool

func (*Server) ReadQuery

func (srv *Server) ReadQuery(ctx *context.Context, req interface{}) bool

type StdResponse

type StdResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type UploadDTO

type UploadDTO struct {
	ID         uint64         `json:"id"`
	CreatedAt  time.Time      `json:"created_at"`
	UpdatedAt  time.Time      `json:"updated_at"`
	DeletedAt  gorm.DeletedAt `json:"deleted_at"`
	Status     int            `json:"status"`
	DriveID    string         `json:"drive_id"`
	RemotePath string         `json:"remote_path"`
	LocalPath  string         `json:"local_path"`
	UploadID   string         `json:"upload_id"`
	Hash       string         `json:"hash"`
	PreHash    string         `json:"pre_hash"`
}

Jump to

Keyboard shortcuts

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