server

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

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNotAllowedWhileLoggedIn = 460
View Source
const HeaderNameContentType = "Content-Type"

Variables

View Source
var FileCachePath string

Functions

func AsJson

func AsJson(w http.ResponseWriter, v interface{}) error

func ResponseToHttp

func ResponseToHttp(w http.ResponseWriter, response *ApiRequestResponse)

Types

type ApiRequestResponse

type ApiRequestResponse struct {
	Error          bool
	HttpStatusCode int
	ContentType    string
	Message        string
}

type Cleanabel

type Cleanabel interface {
	Cleanup(ctx context.Context)
	ShouldBeExecuted(n int) bool
}

type Content

type Content struct {
	Content    ContentType
	Owner      string
	Type       string
	Collection string
}

func (*Content) SetContentObject

func (c *Content) SetContentObject() error

type ContentFile

type ContentFile struct {
	C []byte
	R string
	T string
}

func (*ContentFile) Read

func (f *ContentFile) Read(obj *fastjson.Object) error

func (*ContentFile) ToBsonD

func (f *ContentFile) ToBsonD() *bson.D

type ContentMap

type ContentMap struct {
	C map[string]interface{}
}

func (*ContentMap) Read

func (m *ContentMap) Read(obj *fastjson.Object) error

func (*ContentMap) ToBsonD

func (m *ContentMap) ToBsonD() *bson.D

type ContentType

type ContentType interface {
	ToBsonD() *bson.D
	Read(*fastjson.Object) error
}

type HTTPServer

type HTTPServer struct {
	IsStarted bool
	// contains filtered or unexported fields
}

HTTPServer to handle Stuff

func CreateNew

func CreateNew(port int, staticFilePath string, config *lutra.LutraConfig) (*HTTPServer, error)

CreateNew creates a default HttpServer

func (*HTTPServer) Shutdown

func (h *HTTPServer) Shutdown()

func (*HTTPServer) Start

func (h *HTTPServer) Start()

Start starts a HTTPServer

type HouseKeeperTimer

type HouseKeeperTimer struct {
	Quit chan bool
	// contains filtered or unexported fields
}

func StartNewHouseKeeper

func StartNewHouseKeeper(server *HTTPServer, trigger time.Duration) *HouseKeeperTimer

type Page

type Page struct {
	Language string
	Title    string
	// contains filtered or unexported fields
}

Page is a abstraction for the Go Template handels

func OpenPage

func OpenPage(name string) (*Page, error)

OpenPage perpares a Page Instance to be used

func (*Page) Render

func (p *Page) Render(wr io.Writer, data interface{}) error

Render writes a Template with given data to the Writer

type Session

type Session struct {
	Host          string
	Browser       string
	Created       time.Time
	Challenge     string
	LoginPage     *pages.LoginPage
	RegisterPager *pages.RegisterPage
}

Jump to

Keyboard shortcuts

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