api

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAdminRouter

func InitAdminRouter(apiHelper Helper)

func InitSourcesRouter

func InitSourcesRouter(apiHelper Helper)

func InitTestRouter

func InitTestRouter(api Helper)

func ReadInputRecords

func ReadInputRecords(r heligo.Request, contentType string) ([]database.Record, error)

func SetResponseHeaders added in v0.2.5

func SetResponseHeaders(ctx context.Context, w http.ResponseWriter, r *http.Request, count int64)

func TableCreateHandler

func TableCreateHandler(c context.Context, w http.ResponseWriter, r heligo.Request) (int, error)

func TableDeleteHandler

func TableDeleteHandler(c context.Context, w http.ResponseWriter, r heligo.Request) (int, error)

func TableGetHandler

func TableGetHandler(c context.Context, w http.ResponseWriter, r heligo.Request) (int, error)

func TableListHandler

func TableListHandler(c context.Context, w http.ResponseWriter, r heligo.Request) (int, error)

func TableUpdateHandler

func TableUpdateHandler(c context.Context, w http.ResponseWriter, r heligo.Request) (int, error)

func WriteBadRequest

func WriteBadRequest(w http.ResponseWriter, err error) (int, error)

func WriteContent added in v0.2.5

func WriteContent(ctx context.Context, w http.ResponseWriter, status int, content []byte) (int, error)

func WriteError

func WriteError(w http.ResponseWriter, err error) (int, error)

func WriteServerError

func WriteServerError(w http.ResponseWriter, err error) (int, error)

Types

type Helper added in v0.2.3

type Helper interface {
	GetDBE() *database.DbEngine
	GetDatabase(context.Context, string) (*database.Database, error)
	GetMainDatabase(context.Context) (*database.Database, error)

	Router() *heligo.Router
	MiddlewareStd() heligo.Middleware
	MiddlewareDBE() heligo.Middleware
	MiddlewareWithDbName(string) heligo.Middleware

	BaseAdminURL() string
	BaseAPIURL() string
	HasShortAPIURL() bool

	SessionStatistics() authn.SessionStatistics
}

type SmoothError added in v0.2.4

type SmoothError struct {
	Subsystem string
	Message   string
	Code      string
	Hint      string
	Details   string
	Position  int32
}

Jump to

Keyboard shortcuts

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