records

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: ISC Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EventTypeNew is emitted when a new record is submitted.
	EventTypeNew = "records-new"

	// EventTypeEdit is emitted when a a record is edited.
	EventTypeEdit = "records-edit"

	// EventTypeSetStatus is emitted when a a record status is updated.
	EventTypeSetStatus = "records-setstatus"
)

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using slog.

Types

type EventEdit

type EventEdit struct {
	User   user.User
	Record v1.Record
}

EventEdit is the event data for the EventTypeEdit.

type EventNew

type EventNew struct {
	User   user.User
	Record v1.Record
}

EventNew is the event data for the EventTypeNew.

type EventSetStatus

type EventSetStatus struct {
	Record v1.Record
}

EventSetStatus is the event data for the EventTypeSetStatus.

type Records

type Records struct {
	// contains filtered or unexported fields
}

Records is the context for the records API.

func New

New returns a new Records context.

func (*Records) HandleDetails

func (c *Records) HandleDetails(w http.ResponseWriter, r *http.Request)

HandleDetails is the request handler for the records v1 Details route.

func (*Records) HandleEdit

func (c *Records) HandleEdit(w http.ResponseWriter, r *http.Request)

HandleEdit is the request handler for the records v1 Edit route.

func (*Records) HandleInventory

func (c *Records) HandleInventory(w http.ResponseWriter, r *http.Request)

HandleInventory is the request handler for the records v1 Inventory route.

func (*Records) HandleInventoryOrdered

func (c *Records) HandleInventoryOrdered(w http.ResponseWriter, r *http.Request)

HandleInventoryOrdered is the request handler for the records v1 InventoryOrdered route.

func (*Records) HandleNew

func (c *Records) HandleNew(w http.ResponseWriter, r *http.Request)

HandleNew is the request handler for the records v1 New route.

func (*Records) HandlePolicy added in v1.2.0

func (c *Records) HandlePolicy(w http.ResponseWriter, r *http.Request)

HandlePolicy is the request handler for the records v1 Policy route.

func (*Records) HandleRecords

func (c *Records) HandleRecords(w http.ResponseWriter, r *http.Request)

HandleRecords is the request handler for the records v1 Records route.

func (*Records) HandleSetStatus

func (c *Records) HandleSetStatus(w http.ResponseWriter, r *http.Request)

HandleSetStatus is the request handler for the records v1 SetStatus route.

func (*Records) HandleTimestamps

func (c *Records) HandleTimestamps(w http.ResponseWriter, r *http.Request)

HandleTimestamps is the request handler for the records v1 Timestamps route.

func (*Records) HandleUserRecords

func (c *Records) HandleUserRecords(w http.ResponseWriter, r *http.Request)

HandleUserRecords is the request handler for the records v1 UserRecords route.

Jump to

Keyboard shortcuts

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