extensions

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2019 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Overview

Package extensions provides extension functionality to GAPIS.

Extensions would ideally be plugins, but golang still doesn't have cross platform support. See: https://github.com/golang/go/issues/19282

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(e Extension)

Register registers the extension e.

Types

type EventFilter added in v0.9.0

type EventFilter func(api.CmdID, api.Cmd, *api.GlobalState) bool

EventFilter is a predicate used for filtering event commands. If the function returns true then the command is considered for event generation, otherwise it is ignored.

type EventProvider added in v0.6.1

type EventProvider func(ctx context.Context, id api.CmdID, cmd api.Cmd, s *api.GlobalState) []*service.Event

EventProvider is a function that produces events for the given command and state.

type Extension

type Extension struct {
	// Name of the extension.
	Name string
	// AdjustContexts lets the extension rename or reprioritize the list of
	// contexts.
	AdjustContexts func(context.Context, []*api.ContextInfo)
	// Custom command groupers.
	CmdGroupers func(ctx context.Context, p *path.CommandTree, r *path.ResolveConfig) []cmdgrouper.Grouper
	// Custom events provider.
	Events func(ctx context.Context, p *path.Events, r *path.ResolveConfig) EventProvider
	// Custom events filters.
	EventFilter func(ctx context.Context, p *path.Events, r *path.ResolveConfig) EventFilter
}

Extension is a GAPIS extension. It should be registered at application initialization with Register.

func Get

func Get() []Extension

Get returns the full list of registered extensions.

Directories

Path Synopsis
Package unity provides GAPIS extensions that handle Unity engine features.
Package unity provides GAPIS extensions that handle Unity engine features.

Jump to

Keyboard shortcuts

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