dvmodules

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HookStartEvent = "START"
)
View Source
const (
	StarKey = "StarKey"
)

Variables

This section is empty.

Functions

func AddDynamicAction added in v1.0.2

func AddDynamicAction(action *dvcontext.DvAction, env *dvevaluation.DvObject)

func AnalyzeAuthToken added in v1.0.2

func AnalyzeAuthToken(ctx *dvcontext.RequestContext) (*dvevaluation.DvVariable, error)

func DynamicRegisterEndPointActions added in v1.0.2

func DynamicRegisterEndPointActions(actions []*dvcontext.DvAction, isDynamic bool) dvcontext.HandlerFunc

func FireAction

func FireAction(action *dvcontext.DvAction, request *dvcontext.RequestContext) bool

func FireHookEvent

func FireHookEvent(eventName string, data []interface{}) error

func FireStartHookEvent

func FireStartHookEvent(data []interface{}) error

func HasAnyRoleOf added in v1.0.2

func HasAnyRoleOf(ctx *dvcontext.RequestContext, roles []string) bool

func IsCorrectHash

func IsCorrectHash(s string) bool

func MakeHookGlobalInitialization

func MakeHookGlobalInitialization(moduleInits map[string]map[string]string)

func MakeModuleGlobalInitialization

func MakeModuleGlobalInitialization(moduleInits map[string]map[string]string)

func MakeModuleHandler

func MakeModuleHandler(config *RegistrationConfig, params []string) dvcontext.HandlerFunc

func RegisterActionProcessor

func RegisterActionProcessor(name string, proc ActionEndPointHandler, silent bool) bool

func RegisterEndPointActions

func RegisterEndPointActions(actions []*dvcontext.DvAction) (dvcontext.HandlerFunc, map[string]*dvurl.UrlPool)

func RegisterEndPointHandlers

func RegisterEndPointHandlers(configs []ModuleConfig) dvcontext.HandlerFunc

func RegisterModule

func RegisterModule(config *RegistrationConfig, silent bool) bool

func SubscribeForEvents

func SubscribeForEvents(config *HookRegistrationConfig, silent bool) bool

func ValidateRequest added in v1.0.2

func ValidateRequest(validations []*dvcontext.ValidatePattern, environment *dvevaluation.DvObject) string

Types

type ActionEndPointHandler

type ActionEndPointHandler func(ctx *dvcontext.RequestContext) bool

type HookMethodEndPointHandler

type HookMethodEndPointHandler func(eventName string, data []interface{}) error

type HookRegistrationConfig

type HookRegistrationConfig struct {
	Name              string
	HookEventMapper   map[string]HookMethodEndPointHandler
	GlobalInitHandler MethodGlobalInitHandler
	ServerInitHandler MethodServerInitHandler
}

func GetRegisteredHookConfig

func GetRegisteredHookConfig(name string, silent bool) *HookRegistrationConfig

type MethodEndPointHandler

type MethodEndPointHandler func(request *dvcontext.RequestContext) bool

type MethodGlobalInitHandler

type MethodGlobalInitHandler func(map[string]string) error

type MethodOwnHandlerGenerator

type MethodOwnHandlerGenerator func(url string, params []string, urlPool *dvurl.UrlPool) error

type MethodServerInitHandler

type MethodServerInitHandler func(params []string) (map[string]string, error)

type ModuleConfig

type ModuleConfig struct {
	Name   string   `json:"name"`
	Url    string   `json:"url"`
	Params []string `json:"params"`
}

type RegistrationConfig

type RegistrationConfig struct {
	Name              string
	EndPointHandler   MethodEndPointHandler
	GlobalInitHandler MethodGlobalInitHandler
	ServerInitHandler MethodServerInitHandler
	GenerateHandlers  MethodOwnHandlerGenerator
}

func GetRegisteredConfig

func GetRegisteredConfig(name string, silent bool) *RegistrationConfig

Jump to

Keyboard shortcuts

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