dvmodules

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func FireAction

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

func FireHookEvent

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

func FireStartHookEvent

func FireStartHookEvent(data []interface{}) error

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) dvmeta.HandlerFunc

func RegisterActionProcessor

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

func RegisterEndPointActions

func RegisterEndPointActions(actions []dvmeta.DvAction) dvmeta.HandlerFunc

func RegisterEndPointHandlers

func RegisterEndPointHandlers(configs []ModuleConfig) dvmeta.HandlerFunc

func RegisterModule

func RegisterModule(config *RegistrationConfig, silent bool) bool

func SubscribeForEvents

func SubscribeForEvents(config *HookRegistrationConfig, silent bool) bool

Types

type ActionEndPointHandler

type ActionEndPointHandler func(request *dvmeta.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 *dvmeta.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