Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorData(errObj any) map[string]any
- func ErrorJSON(err any) string
- func ErrorJSONBytes(err any) []byte
- func ErrorType(errObj any) string
- func MemoryStorage(id, content string) hist.DocStorage
- type LeisureContext
- type LeisureError
- type LeisureService
- type LeisureSession
- type Sha
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 ErrorJSONBytes ¶ added in v0.0.1
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 ¶
Click to show internal directories.
Click to hide internal directories.