context

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessRequest

func ProcessRequest(request *action.Request, context *Context) *action.Request

Types

type Context

type Context struct {
	Id         string             `json:"_id"`
	Status     bool               `json:"status"`
	Timestamp  int64              `json:"timestamp"`
	Dictionary DictionaryCategory `json:"dictionary"`
	Owner      string             `json:"owner"`
	Collection string             `json:"collection"`
	Modified   int64              `json:"modified"`
}

func NewContext

func NewContext(owner string) *Context

func (Context) Apply

func (c Context) Apply(category, source string) string

func (Context) IdentifyVariables

func (c Context) IdentifyVariables(category, source string) []collection.Pair[string, string]

func (*Context) Put

func (c *Context) Put(category ContextCategoy, key, value string, private bool) *Context

func (*Context) PutAll

func (c *Context) PutAll(category string, context map[string]ItemContext) *Context

type ContextCategoy

type ContextCategoy string
const (
	URI     ContextCategoy = "uri"
	QUERY   ContextCategoy = "query"
	HEADER  ContextCategoy = "header"
	COOKIE  ContextCategoy = "cookie"
	PAYLOAD ContextCategoy = "payload"
	AUTH    ContextCategoy = "auth"
)

func (ContextCategoy) String

func (s ContextCategoy) String() string

type DictionaryVariables

type DictionaryVariables = collection.Dictionary[string, ItemContext]

type ItemContext

type ItemContext struct {
	Order   int64  `json:"order"`
	Private bool   `json:"private"`
	Status  bool   `json:"status"`
	Value   string `json:"value"`
}

func NewItemContext

func NewItemContext(order int64, private, status bool, value string) ItemContext

type Repository

type Repository interface {
	Find(id string) (*Context, bool)
	Insert(owner string, collection string, context *Context) *Context
	Update(owner string, context *Context) (*Context, bool)
	Delete(context *Context) *Context
}

Jump to

Keyboard shortcuts

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