api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Pacakge api contains HTTP handlers for working with KMFDDM data. This includes delcarations, sets, enrollments, status data, notifications, etc.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyResourceID = errors.New("empty resource id")

Functions

func DeleteDeclarationHandler

func DeleteDeclarationHandler(store storage.DeclarationDeleter, logger log.Logger) http.HandlerFunc

DeleteDeclarationHandler deletes a declaration by its identifier. We assume that any declaration deleted has no dependant delcarations and is not in any other sets (and so we perform no notifications). The entire request URL path is assumed to contain the declaration identifier. This implies the handler should have the path prefix stripped before use.

func DeleteEnrollmentSetHandler

func DeleteEnrollmentSetHandler(store storage.EnrollmentSetRemover, notifier Notifier, logger log.Logger) http.HandlerFunc

DeleteEnrollmentSetHandler returns a handle that dissociates a set from an enrollment.

func DeleteSetDeclarationHandler

func DeleteSetDeclarationHandler(store storage.SetDeclarationRemover, notifier Notifier, logger log.Logger) http.HandlerFunc

DeleteSetDeclarationHandler dissociates declarations from a set. The entire request URL path is assumed to contain the set name. This implies the handler should have the path prefix stripped before use.

func GetDeclarationHandler

func GetDeclarationHandler(store storage.DeclarationAPIRetriever, logger log.Logger) http.HandlerFunc

GetDeclarationHandler retrieves a declaration by its identifier. The entire request URL path is assumed to contain the declaration identifier. This implies the handler should have the path prefix stripped before use.

func GetDeclarationSetsHandler

func GetDeclarationSetsHandler(store storage.DeclarationSetRetriever, logger log.Logger) http.HandlerFunc

GetDeclarationSetsHandler retrieves the list of sets for an declaration ID. The entire request URL path is assumed to contain the set name. This implies the handler should have the path prefix stripped before use.

func GetDeclarationStatusHandler

func GetDeclarationStatusHandler(store storage.StatusDeclarationsRetriever, logger log.Logger) http.HandlerFunc

GetDeclarationStatusHandler returns a handler that retrives that last declaration status for an enrollment ID.

func GetDeclarationsHandler

func GetDeclarationsHandler(store storage.DeclarationsRetriever, logger log.Logger) http.HandlerFunc

GetDeclarationsHandler returns a handler that lists declarations.

func GetEnrollmentSetsHandler

func GetEnrollmentSetsHandler(store storage.EnrollmentSetsRetriever, logger log.Logger) http.HandlerFunc

GetEnrollmentSetsHandler returns a handle that retrieves the list of sets for an enrollment ID.

func GetSetDeclarationsHandler

func GetSetDeclarationsHandler(store storage.SetDeclarationsRetriever, logger log.Logger) http.HandlerFunc

GetSetDeclarationsHandler retrieves the list of declarations in a set. The entire request URL path is assumed to contain the set name. This implies the handler should have the path prefix stripped before use.

func GetSetsHandler

func GetSetsHandler(store storage.SetRetreiver, logger log.Logger) http.HandlerFunc

GetSetsHandler returns a handler that retrieves the list of sets.

func GetStatusErrorsHandler

func GetStatusErrorsHandler(store storage.StatusErrorsRetriever, logger log.Logger) http.HandlerFunc

GetStatusErrorsHandler returns a handler that retrieves the collected errors for an enrollment.

func GetStatusReportHandler added in v0.4.0

func GetStatusReportHandler(store storage.StatusReportRetriever, logger log.Logger) http.HandlerFunc

GetStatusReportHandler returns a handler that retrieves a status report for en enrollment.

func GetStatusValuesHandler

func GetStatusValuesHandler(store storage.StatusValuesRetriever, logger log.Logger) http.HandlerFunc

GetStatusValuesHandler returns a handler that retrieves the collected values for an enrollment.

func NotifyHandler added in v0.4.0

func NotifyHandler(notifier Notifier, logger log.Logger) http.HandlerFunc

NotifyHandler notifies enrollment IDs.

func PutDeclarationHandler

func PutDeclarationHandler(store storage.DeclarationStorer, notifier Notifier, logger log.Logger) http.HandlerFunc

PutDeclarationHandler returns a handler that stores a declaration.

func PutEnrollmentSetHandler

func PutEnrollmentSetHandler(store storage.EnrollmentSetStorer, notifier Notifier, logger log.Logger) http.HandlerFunc

PutEnrollmentSetHandler returns a handle that associates a set to an enrollment.

func PutSetDeclarationHandler

func PutSetDeclarationHandler(store storage.SetDeclarationStorer, notifier Notifier, logger log.Logger) http.HandlerFunc

PutSetDeclarationHandler associates declarations to a set. The entire request URL path is assumed to contain the set name. This implies the handler should have the path prefix stripped before use.

func TouchDeclarationHandler added in v0.4.0

func TouchDeclarationHandler(store storage.Toucher, notifier Notifier, logger log.Logger) http.HandlerFunc

TouchDeclarationHandler modifies a declaration ServerToken specified by ID.

Types

type Notifier

type Notifier interface {
	Changed(ctx context.Context, declarations []string, sets []string, ids []string) error
}

Jump to

Keyboard shortcuts

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