jsontree

package
v0.0.0-...-cbce884 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRoutes

func SetRoutes(engine *gin.Engine, datastore interfaces.Datastore, cache redis.UniversalClient, processor *events.Processor, config *config.AppConfig) error

SetRoutes sets all of the appropriate routes to handlers for the application

Types

type Handler

type Handler interface {
	ListRootKeys(c *gin.Context)
	CreateRootKey(c *gin.Context)
	UpdateRootKey(c *gin.Context)
	ReadRootKey(c *gin.Context)
	DeleteRootKey(c *gin.Context)
	ReadJSONKey(c *gin.Context)
	CreateJSONKey(c *gin.Context)
	UpdateJSONKey(c *gin.Context)
	DeleteJSONKey(c *gin.Context)

	ListUsage(c *gin.Context)
}

Handler is an interface to the JSON key/val HTTP handler functions.

type Handlers

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

Handlers contains all handler functions

func NewHandlers

func NewHandlers(datastore interfaces.Datastore) *Handlers

NewHandlers creates and returns a new instance of `Handlers` with the datastore

func (*Handlers) CreateJSONKey

func (h *Handlers) CreateJSONKey(c *gin.Context)

CreateJSONKey updates a key at the key path. An error is returned if the key already exists.

func (*Handlers) CreateRootKey

func (h *Handlers) CreateRootKey(c *gin.Context)

CreateRootKey creates a new JSON tree for a rootKey name

func (*Handlers) DeleteJSONKey

func (h *Handlers) DeleteJSONKey(c *gin.Context)

DeleteJSONKey deletes a project key at the key path

func (*Handlers) DeleteRootKey

func (h *Handlers) DeleteRootKey(c *gin.Context)

DeleteRootKey deletes the entire rootKey

func (*Handlers) ListRootKeys

func (h *Handlers) ListRootKeys(c *gin.Context)

ListRootKeys returns the full list of root keys for a project, does not include data for the key

func (*Handlers) ListUsage

func (d *Handlers) ListUsage(c *gin.Context)

ListUsage returns the list of activity logs for a project and endpoint type

func (*Handlers) ReadJSONKey

func (h *Handlers) ReadJSONKey(c *gin.Context)

ReadJSONKey retrieves the data stored at the key path provided by the HTTP path parameters

func (*Handlers) ReadRootKey

func (h *Handlers) ReadRootKey(c *gin.Context)

ReadRootKey retrieves the root JSON tree

func (*Handlers) UpdateJSONKey

func (h *Handlers) UpdateJSONKey(c *gin.Context)

UpdateJSONKey updates a root key at the key path. The key is created if it does not already exist.

func (*Handlers) UpdateRootKey

func (h *Handlers) UpdateRootKey(c *gin.Context)

UpdateRootKey updates the access policies

type Usage

type Usage struct {
	RequestCount      int64         `json:"request_count"`
	TotalResponseTime int64         `json:"-"`
	AvgResponse       int64         `json:"avg_response"`
	StatusCodes       map[int]int64 `json:"status_codes"`
}

Usage wraps usage statistics for JSON keys

Jump to

Keyboard shortcuts

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