hook

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalResolverHooksContextKey = "GlobalResolverHooks"

GlobalResolverHooksContextKey is the global resolver hooks context key

View Source
const ResolverHooksContextKey = "ResolverHooks"

ResolverHooksContextKey is the resolver hooks context key

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHook

type CommandHook interface {
	RegisterNewHook(CommandHookFn)
	Hook() CommandHookFn
}

CommandHook defines a list of HookFn

func NewCommandHook

func NewCommandHook() CommandHook

NewCommandHook returns a new CommandHook

type CommandHookFn

type CommandHookFn func(*cobra.Command) error

CommandHookFn defines the signature of <any> command hook function

type GlobalPostCreateHooksFn

type GlobalPostCreateHooksFn []PostCreateHookFn

GlobalPostCreateHooksFn defines a list of resolver hook function

type GlobalPostDeleteHooksFn

type GlobalPostDeleteHooksFn []PostDeleteHookFn

GlobalPostDeleteHooksFn defines a list of resolver hook function

type GlobalPostListingHooksFn

type GlobalPostListingHooksFn []PostListingHookFn

GlobalPostListingHooksFn defines a list of resolver hook function

type GlobalPostSingleHooksFn

type GlobalPostSingleHooksFn []PostSingleHookFn

GlobalPostSingleHooksFn defines a list of resolver hook function

type GlobalPostUpdateHooksFn

type GlobalPostUpdateHooksFn []PostUpdateHookFn

GlobalPostUpdateHooksFn defines a list of resolver hook function

type GlobalPreCreateHooksFn

type GlobalPreCreateHooksFn []PreCreateHookFn

GlobalPreCreateHooksFn defines a list of resolver hook function

type GlobalPreDeleteHooksFn

type GlobalPreDeleteHooksFn []PreDeleteHookFn

GlobalPreDeleteHooksFn defines a list of resolver hook function

type GlobalPreListingHooksFn

type GlobalPreListingHooksFn []PreListingHookFn

GlobalPreListingHooksFn defines a list of resolver hook function

type GlobalPreSingleHooksFn

type GlobalPreSingleHooksFn []PreSingleHookFn

GlobalPreSingleHooksFn defines a list of resolver hook function

type GlobalPreUpdateHooksFn

type GlobalPreUpdateHooksFn []PreUpdateHookFn

GlobalPreUpdateHooksFn defines a list of resolver hook function

type GlobalResolverHooks

type GlobalResolverHooks interface {
	RegisterNewGlobalPreSingleHook(hook PreSingleHookFn)
	RegisterNewGlobalPostSingleHook(hook PostSingleHookFn)
	RegisterNewGlobalPreListingHook(hook PreListingHookFn)
	RegisterNewGlobalPostListingHook(hook PostListingHookFn)
	RegisterNewGlobalPreCreateHook(hook PreCreateHookFn)
	RegisterNewGlobalPostCreateHook(hook PostCreateHookFn)
	RegisterNewGlobalPreUpdateHook(hook PreUpdateHookFn)
	RegisterNewGlobalPostUpdateHook(hook PostUpdateHookFn)
	RegisterNewGlobalPreDeleteHook(hook PreDeleteHookFn)
	RegisterNewGlobalPostDeleteHook(hook PostDeleteHookFn)

	GlobalPreSingleHooks() GlobalPreSingleHooksFn
	GlobalPostSingleHooks() GlobalPostSingleHooksFn
	GlobalPreListingHooks() GlobalPreListingHooksFn
	GlobalPostListingHooks() GlobalPostListingHooksFn
	GlobalPreCreateHooks() GlobalPreCreateHooksFn
	GlobalPostCreateHooks() GlobalPostCreateHooksFn
	GlobalPreUpdateHooks() GlobalPreUpdateHooksFn
	GlobalPostUpdateHooks() GlobalPostUpdateHooksFn
	GlobalPreDeleteHooks() GlobalPreDeleteHooksFn
	GlobalPostDeleteHooks() GlobalPostDeleteHooksFn
}

GlobalResolverHooks defines a list of common hooks for the various resolvers

func GetGlobalResolverHooksFromCtx

func GetGlobalResolverHooksFromCtx(ctx context.Context) GlobalResolverHooks

GetGlobalResolverHooksFromCtx returns session from context

func NewGlobalResolverHooks

func NewGlobalResolverHooks() GlobalResolverHooks

NewGlobalResolverHooks return a new GlobalResolverHooks

type HTTPHookFn

type HTTPHookFn func(*mux.Router) error

HTTPHookFn defines the signature of <any> http hook function

type HTTPHooks

type HTTPHooks interface {
	RegisterNewHook(HTTPHookFn)
	Hooks() []HTTPHookFn
}

HTTPHooks defines a list of HookFn

func NewHTTPHooks

func NewHTTPHooks() HTTPHooks

NewHTTPHooks returns a new HTTPHooks

type InstallHook

type InstallHook interface {
	RegisterNewHook(InstallHookFn)
	Hook() InstallHookFn
}

InstallHook defines the install hook

func NewInstallHook

func NewInstallHook() InstallHook

NewInstallHook returns a new InstallHook

type InstallHookFn

type InstallHookFn func() error

InstallHookFn defines the signature of the install hook

type LoadedHook

type LoadedHook interface {
	RegisterNewHook(LoadedHookFn)
	Hook() LoadedHookFn
}

LoadedHook defines the Loaded hook

func NewLoadedHook

func NewLoadedHook() LoadedHook

NewLoadedHook returns a new LoadedHook

type LoadedHookFn

type LoadedHookFn func(config.Config, schematic.Schematics, map[string]interface{}) error

LoadedHookFn defines the signature of the Loaded hook Parameters are configuration, schematics, plugin_setting_name -> val

type PostCreateHookFn

type PostCreateHookFn func(string, *graphql.ResolveParams, interface{}) (interface{}, error)

PostCreateHookFn defines the signature of resolver post hook function

type PostCreateHooksFn

type PostCreateHooksFn map[string][]PostCreateHookFn

PostCreateHooksFn defines a map of entityname to resolver hook function

type PostDeleteHookFn

type PostDeleteHookFn func(string, *graphql.ResolveParams, interface{}) (interface{}, error)

PostDeleteHookFn defines the signature of resolver post hook function

type PostDeleteHooksFn

type PostDeleteHooksFn map[string][]PostDeleteHookFn

PostDeleteHooksFn defines a map of entityname to resolver hook function

type PostListingHookFn

type PostListingHookFn func(string, *graphql.ResolveParams, []interface{}) ([]interface{}, error)

PostListingHookFn defines the signature of resolver post hook function

type PostListingHooksFn

type PostListingHooksFn map[string][]PostListingHookFn

PostListingHooksFn defines a map of entityname to resolver hook function

type PostSingleHookFn

type PostSingleHookFn func(string, *graphql.ResolveParams, interface{}) (interface{}, error)

PostSingleHookFn defines the signature of resolver post hook function

type PostSingleHooksFn

type PostSingleHooksFn map[string][]PostSingleHookFn

PostSingleHooksFn defines a map of entityname to resolver hook function

type PostUpdateHookFn

type PostUpdateHookFn func(string, *graphql.ResolveParams, interface{}) (interface{}, error)

PostUpdateHookFn defines the signature of resolver post hook function

type PostUpdateHooksFn

type PostUpdateHooksFn map[string][]PostUpdateHookFn

PostUpdateHooksFn defines a map of entityname to resolver hook function

type PreCreateHookFn

type PreCreateHookFn func(string, *graphql.ResolveParams) error

PreCreateHookFn defines the signature of resolver pre hook function

type PreCreateHooksFn

type PreCreateHooksFn map[string][]PreCreateHookFn

PreCreateHooksFn defines a map of entityname to resolver hook function

type PreDeleteHookFn

type PreDeleteHookFn func(string, *graphql.ResolveParams) error

PreDeleteHookFn defines the signature of resolver pre hook function

type PreDeleteHooksFn

type PreDeleteHooksFn map[string][]PreDeleteHookFn

PreDeleteHooksFn defines a map of entityname to resolver hook function

type PreListingHookFn

type PreListingHookFn func(string, *graphql.ResolveParams) error

PreListingHookFn defines the signature of resolver pre hook function

type PreListingHooksFn

type PreListingHooksFn map[string][]PreListingHookFn

PreListingHooksFn defines a map of entityname to resolver hook function

type PreSingleHookFn

type PreSingleHookFn func(string, *graphql.ResolveParams) error

PreSingleHookFn defines the signature of resolver pre hook function

type PreSingleHooksFn

type PreSingleHooksFn map[string][]PreSingleHookFn

PreSingleHooksFn defines a map of entityname to resolver hook function

type PreUpdateHookFn

type PreUpdateHookFn func(string, *graphql.ResolveParams) error

PreUpdateHookFn defines the signature of resolver pre hook function

type PreUpdateHooksFn

type PreUpdateHooksFn map[string][]PreUpdateHookFn

PreUpdateHooksFn defines a map of entityname to resolver hook function

type ResolverHooks

type ResolverHooks interface {
	RegisterNewPreSingleHook(entityname string, hook PreSingleHookFn)
	RegisterNewPostSingleHook(entityname string, hook PostSingleHookFn)
	RegisterNewPreListingHook(entityname string, hook PreListingHookFn)
	RegisterNewPostListingHook(entityname string, hook PostListingHookFn)
	RegisterNewPreCreateHook(entityname string, hook PreCreateHookFn)
	RegisterNewPostCreateHook(entityname string, hook PostCreateHookFn)
	RegisterNewPreUpdateHook(entityname string, hook PreUpdateHookFn)
	RegisterNewPostUpdateHook(entityname string, hook PostUpdateHookFn)
	RegisterNewPreDeleteHook(entityname string, hook PreDeleteHookFn)
	RegisterNewPostDeleteHook(entityname string, hook PostDeleteHookFn)

	PreSingleHooks() PreSingleHooksFn
	PostSingleHooks() PostSingleHooksFn
	PreListingHooks() PreListingHooksFn
	PostListingHooks() PostListingHooksFn
	PreCreateHooks() PreCreateHooksFn
	PostCreateHooks() PostCreateHooksFn
	PreUpdateHooks() PreUpdateHooksFn
	PostUpdateHooks() PostUpdateHooksFn
	PreDeleteHooks() PreDeleteHooksFn
	PostDeleteHooks() PostDeleteHooksFn
}

ResolverHooks defines a list of common hooks for the various resolvers

func GetResolverHooksFromCtx

func GetResolverHooksFromCtx(ctx context.Context) ResolverHooks

GetResolverHooksFromCtx returns session from context

func NewResolverHooks

func NewResolverHooks() ResolverHooks

NewResolverHooks return a new ResolverHooks

type SchemaHookFn

type SchemaHookFn func(graphql.Fields) error

SchemaHookFn defines the signature for the schema hook function

type SchemaHooks

type SchemaHooks interface {
	RegisterNewQueryHook(SchemaHookFn)
	RegisterNewMutationHook(SchemaHookFn)

	QueryHooks() []SchemaHookFn
	MutationHooks() []SchemaHookFn
}

SchemaHooks operates on SchemaHooksFn

func NewSchemaHooks

func NewSchemaHooks() SchemaHooks

NewSchemaHooks returns a new SchemaHooks

type UninstallHook

type UninstallHook interface {
	RegisterNewHook(UninstallHookFn)
	Hook() UninstallHookFn
}

UninstallHook defines the Uninstall hook

func NewUninstallHook

func NewUninstallHook() UninstallHook

NewUninstallHook returns a new UninstallHook

type UninstallHookFn

type UninstallHookFn func() error

UninstallHookFn defines the signature of the Uninstall hook

Jump to

Keyboard shortcuts

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