api

package
v0.0.0-...-8495d1f Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(public *mux.Router, context *Context)

Register registers the API endpoints on the given router.

Types

type ApiTestHelper

type ApiTestHelper struct {
	App      *app.App
	Router   *mux.Router
	Server   *httptest.Server
	SqlStore *store.SqlStore
}

func SetupApiTestHelper

func SetupApiTestHelper(t *testing.T) *ApiTestHelper

func (*ApiTestHelper) TearDown

func (th *ApiTestHelper) TearDown(t *testing.T)

type Context

type Context struct {
	RequestID string
	Logger    logrus.FieldLogger
	App       *app.App
	Session   *model.Session
}

Context provides the API with all necessary data and interfaces for responding to requests.

func (*Context) Clone

func (c *Context) Clone() *Context

Clone creates a shallow copy of context, allowing clones to apply per-request changes.

Jump to

Keyboard shortcuts

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