api

package
v0.0.0-...-dd30ea9 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiBase

type ApiBase struct {
	Database *database.DbOperations
	Setup    *setup.Setup
}

func New

func New(db *database.DbOperations, setup *setup.Setup) *ApiBase

func (*ApiBase) CurrentSession

func (base *ApiBase) CurrentSession(c web.C) *domain.Session

func (*ApiBase) Decode

func (base *ApiBase) Decode(v interface{}, r *http.Request) error

func (*ApiBase) ErrorResponse

func (base *ApiBase) ErrorResponse(tx interface{}, err error, w http.ResponseWriter)

func (*ApiBase) IpAddress

func (base *ApiBase) IpAddress(r *http.Request) string

func (*ApiBase) ParamValue

func (base *ApiBase) ParamValue(name string, c web.C, r *http.Request) string

gets the parameter value from the query string or from the url

func (*ApiBase) Response

func (base *ApiBase) Response(tx interface{}, err error, w http.ResponseWriter, data interface{})

func (*ApiBase) SuccessResponse

func (base *ApiBase) SuccessResponse(tx interface{}, w http.ResponseWriter)

type HttpMessage

type HttpMessage struct {
	StatusCode int
	Message    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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