server

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VERSION         = "/v1"
	DOC_CREATE      = VERSION + "/doc/create/"
	DOC_GET         = VERSION + "/doc/get/"
	DOC_LIST        = VERSION + "/doc/list"
	SESSION_CONNECT = VERSION + "/session/connect/"
	SESSION_CREATE  = VERSION + "/session/create/"
	SESSION_LIST    = VERSION + "/session/list"
	SESSION_GET     = VERSION + "/session/get"
	SESSION_EDIT    = VERSION + "/session/edit"
	SESSION_UPDATE  = VERSION + "/session/update"
)
View Source
const (
	DEFAULT_COOKIE_TIMEOUT = 5 * time.Minute
)
View Source
const JSON_TAG = `(^|,)json:"([^"]+)"`

Variables

View Source
var ErrCommandFormat = NewLeisureError("badCommandFormat")
View Source
var ErrDocumentAliasExists = NewLeisureError("documentAliasExists")
View Source
var ErrDocumentExists = NewLeisureError("documentExists")
View Source
var ErrDuplicateConnection = NewLeisureError("duplicateConnection")
View Source
var ErrDuplicateSession = NewLeisureError("duplicateSession")
View Source
var ErrExpiredSession = NewLeisureError("expiredSession")
View Source
var ErrInternalError = NewLeisureError("internalError")
View Source
var ErrUnknown = NewLeisureError("unknownError")
View Source
var ErrUnknownDocument = NewLeisureError("unknownDocument")
View Source
var ErrUnknownSession = NewLeisureError("unknownSession")

Functions

func ErrorData added in v0.0.1

func ErrorData(errObj any) map[string]any

func ErrorJSON added in v0.0.1

func ErrorJSON(err any) string

func ErrorJSONBytes added in v0.0.1

func ErrorJSONBytes(err any) []byte

func ErrorType added in v0.0.1

func ErrorType(errObj any) string

func MemoryStorage

func MemoryStorage(id, content string) hist.DocStorage

Types

type LeisureContext added in v0.0.1

type LeisureContext struct {
	*LeisureService
	// contains filtered or unexported fields
}

type LeisureError added in v0.0.1

type LeisureError struct {
	Type string
	Data map[string]any
	// contains filtered or unexported fields
}

func NewLeisureError added in v0.0.1

func NewLeisureError(errorType string, values ...any) LeisureError

func (LeisureError) Error added in v0.0.1

func (err LeisureError) Error() string

func (LeisureError) Unwrap added in v0.0.1

func (err LeisureError) Unwrap() error

type LeisureService

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

func Initialize

func Initialize(id string, mux *http.ServeMux, storageFactory func(string, string) hist.DocStorage) *LeisureService

func NewWebService

func NewWebService(id string, storageFactory func(string, string) hist.DocStorage) *LeisureService

func (*LeisureService) SetVerbose added in v0.0.1

func (sv *LeisureService) SetVerbose(n int)

type LeisureSession

type LeisureSession struct {
	*hist.Session
	// contains filtered or unexported fields
}

type Sha added in v0.0.1

type Sha = [sha256.Size]byte

Jump to

Keyboard shortcuts

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