Documentation
¶
Index ¶
- Variables
- func Activate(reg *Registration)
- func Deactivate(reg *Registration)
- func RegisterPluginServer(s *grpc.Server, srv PluginServer)
- func Serve(reg *Registration, hooks map[hooks.Hook]hooks.Handler, ...)
- type FilterData
- func (*FilterData) Descriptor() ([]byte, []int)
- func (m *FilterData) GetData() []byte
- func (m *FilterData) GetFilterName() string
- func (*FilterData) ProtoMessage()
- func (m *FilterData) Reset()
- func (m *FilterData) String() string
- func (m *FilterData) XXX_DiscardUnknown()
- func (m *FilterData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FilterData) XXX_Merge(src proto.Message)
- func (m *FilterData) XXX_Size() int
- func (m *FilterData) XXX_Unmarshal(b []byte) error
- type FullRegistration
- func (*FullRegistration) Descriptor() ([]byte, []int)
- func (m *FullRegistration) GetReg() *Registration
- func (m *FullRegistration) GetRepo() *Repository
- func (*FullRegistration) ProtoMessage()
- func (m *FullRegistration) Reset()
- func (m *FullRegistration) String() string
- func (m *FullRegistration) XXX_DiscardUnknown()
- func (m *FullRegistration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FullRegistration) XXX_Merge(src proto.Message)
- func (m *FullRegistration) XXX_Size() int
- func (m *FullRegistration) XXX_Unmarshal(b []byte) error
- type Handler
- func (*Handler) Descriptor() ([]byte, []int)
- func (m *Handler) GetSpecs() []*Spec
- func (*Handler) ProtoMessage()
- func (m *Handler) Reset()
- func (m *Handler) String() string
- func (m *Handler) XXX_DiscardUnknown()
- func (m *Handler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Handler) XXX_Merge(src proto.Message)
- func (m *Handler) XXX_Size() int
- func (m *Handler) XXX_Unmarshal(b []byte) error
- type HookRequest
- func (*HookRequest) Descriptor() ([]byte, []int)
- func (m *HookRequest) GetData() []byte
- func (m *HookRequest) GetHookName() string
- func (*HookRequest) ProtoMessage()
- func (m *HookRequest) Reset()
- func (m *HookRequest) String() string
- func (m *HookRequest) XXX_DiscardUnknown()
- func (m *HookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HookRequest) XXX_Merge(src proto.Message)
- func (m *HookRequest) XXX_Size() int
- func (m *HookRequest) XXX_Unmarshal(b []byte) error
- type HookResponse
- func (*HookResponse) Descriptor() ([]byte, []int)
- func (m *HookResponse) GetData() []byte
- func (*HookResponse) ProtoMessage()
- func (m *HookResponse) Reset()
- func (m *HookResponse) String() string
- func (m *HookResponse) XXX_DiscardUnknown()
- func (m *HookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HookResponse) XXX_Merge(src proto.Message)
- func (m *HookResponse) XXX_Size() int
- func (m *HookResponse) XXX_Unmarshal(b []byte) error
- type InitRequest
- func (*InitRequest) Descriptor() ([]byte, []int)
- func (*InitRequest) ProtoMessage()
- func (m *InitRequest) Reset()
- func (m *InitRequest) String() string
- func (m *InitRequest) XXX_DiscardUnknown()
- func (m *InitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *InitRequest) XXX_Merge(src proto.Message)
- func (m *InitRequest) XXX_Size() int
- func (m *InitRequest) XXX_Unmarshal(b []byte) error
- type PluginClient
- type PluginServer
- type Registration
- func (*Registration) Descriptor() ([]byte, []int)
- func (m *Registration) GetCustomFilters() []string
- func (m *Registration) GetCustomHooks() []string
- func (m *Registration) GetFilters() map[string]*Handler
- func (m *Registration) GetHooks() map[string]*Handler
- func (m *Registration) GetId() string
- func (m *Registration) GetName() string
- func (m *Registration) GetSpecs() []*Spec
- func (m *Registration) GetVer() *version.Version
- func (*Registration) ProtoMessage()
- func (m *Registration) Reset()
- func (m *Registration) String() string
- func (m *Registration) XXX_DiscardUnknown()
- func (m *Registration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Registration) XXX_Merge(src proto.Message)
- func (m *Registration) XXX_Size() int
- func (m *Registration) XXX_Unmarshal(b []byte) error
- type Repository
- func (*Repository) Descriptor() ([]byte, []int)
- func (m *Repository) GetId() string
- func (m *Repository) GetName() string
- func (m *Repository) GetRootUrl() string
- func (*Repository) ProtoMessage()
- func (m *Repository) Reset()
- func (m *Repository) String() string
- func (m *Repository) XXX_DiscardUnknown()
- func (m *Repository) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Repository) XXX_Merge(src proto.Message)
- func (m *Repository) XXX_Size() int
- func (m *Repository) XXX_Unmarshal(b []byte) error
- type Spec
- func (*Spec) Descriptor() ([]byte, []int)
- func (m *Spec) GetType() uint32
- func (m *Spec) GetValue() string
- func (*Spec) ProtoMessage()
- func (m *Spec) Reset()
- func (m *Spec) String() string
- func (m *Spec) XXX_DiscardUnknown()
- func (m *Spec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Spec) XXX_Merge(src proto.Message)
- func (m *Spec) XXX_Size() int
- func (m *Spec) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var HostSideFilters = hostSideFilters{ // contains filtered or unexported fields }
var HostSideHooks = hostSideHooks{ // contains filtered or unexported fields }
var PluginSideFilters = pluginSideFilters{ // contains filtered or unexported fields }
var PluginSideHooks = pluginSideHooks{ // contains filtered or unexported fields }
Functions ¶
func Activate ¶
func Activate(reg *Registration)
Activate is used by the host system to activate a plugin for the current server instance. This does not register the activation of a plugin in the system database.
func Deactivate ¶
func Deactivate(reg *Registration)
func RegisterPluginServer ¶
func RegisterPluginServer(s *grpc.Server, srv PluginServer)
Types ¶
type FilterData ¶
type FilterData struct {
FilterName string `protobuf:"bytes,1,opt,name=filter_name,json=filterName,proto3" json:"filter_name,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*FilterData) Descriptor ¶
func (*FilterData) Descriptor() ([]byte, []int)
func (*FilterData) GetData ¶
func (m *FilterData) GetData() []byte
func (*FilterData) GetFilterName ¶
func (m *FilterData) GetFilterName() string
func (*FilterData) ProtoMessage ¶
func (*FilterData) ProtoMessage()
func (*FilterData) Reset ¶
func (m *FilterData) Reset()
func (*FilterData) String ¶
func (m *FilterData) String() string
func (*FilterData) XXX_DiscardUnknown ¶
func (m *FilterData) XXX_DiscardUnknown()
func (*FilterData) XXX_Marshal ¶
func (m *FilterData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FilterData) XXX_Merge ¶
func (m *FilterData) XXX_Merge(src proto.Message)
func (*FilterData) XXX_Size ¶
func (m *FilterData) XXX_Size() int
func (*FilterData) XXX_Unmarshal ¶
func (m *FilterData) XXX_Unmarshal(b []byte) error
type FullRegistration ¶
type FullRegistration struct {
Reg *Registration `protobuf:"bytes,1,opt,name=reg,proto3" json:"reg,omitempty"`
Repo *Repository `protobuf:"bytes,2,opt,name=repo,proto3" json:"repo,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*FullRegistration) Descriptor ¶
func (*FullRegistration) Descriptor() ([]byte, []int)
func (*FullRegistration) GetReg ¶
func (m *FullRegistration) GetReg() *Registration
func (*FullRegistration) GetRepo ¶
func (m *FullRegistration) GetRepo() *Repository
func (*FullRegistration) ProtoMessage ¶
func (*FullRegistration) ProtoMessage()
func (*FullRegistration) Reset ¶
func (m *FullRegistration) Reset()
func (*FullRegistration) String ¶
func (m *FullRegistration) String() string
func (*FullRegistration) XXX_DiscardUnknown ¶
func (m *FullRegistration) XXX_DiscardUnknown()
func (*FullRegistration) XXX_Marshal ¶
func (m *FullRegistration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*FullRegistration) XXX_Merge ¶
func (m *FullRegistration) XXX_Merge(src proto.Message)
func (*FullRegistration) XXX_Size ¶
func (m *FullRegistration) XXX_Size() int
func (*FullRegistration) XXX_Unmarshal ¶
func (m *FullRegistration) XXX_Unmarshal(b []byte) error
type Handler ¶
type Handler struct {
Specs []*Spec `protobuf:"bytes,1,rep,name=specs,proto3" json:"specs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
A Handler is generated out of a hooks.Handler or filters.Handler.
func (*Handler) Descriptor ¶
func (*Handler) ProtoMessage ¶
func (*Handler) ProtoMessage()
func (*Handler) XXX_DiscardUnknown ¶
func (m *Handler) XXX_DiscardUnknown()
func (*Handler) XXX_Marshal ¶
func (*Handler) XXX_Unmarshal ¶
type HookRequest ¶
type HookRequest struct {
HookName string `protobuf:"bytes,1,opt,name=hook_name,json=hookName,proto3" json:"hook_name,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*HookRequest) Descriptor ¶
func (*HookRequest) Descriptor() ([]byte, []int)
func (*HookRequest) GetData ¶
func (m *HookRequest) GetData() []byte
func (*HookRequest) GetHookName ¶
func (m *HookRequest) GetHookName() string
func (*HookRequest) ProtoMessage ¶
func (*HookRequest) ProtoMessage()
func (*HookRequest) Reset ¶
func (m *HookRequest) Reset()
func (*HookRequest) String ¶
func (m *HookRequest) String() string
func (*HookRequest) XXX_DiscardUnknown ¶
func (m *HookRequest) XXX_DiscardUnknown()
func (*HookRequest) XXX_Marshal ¶
func (m *HookRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HookRequest) XXX_Merge ¶
func (m *HookRequest) XXX_Merge(src proto.Message)
func (*HookRequest) XXX_Size ¶
func (m *HookRequest) XXX_Size() int
func (*HookRequest) XXX_Unmarshal ¶
func (m *HookRequest) XXX_Unmarshal(b []byte) error
type HookResponse ¶
type HookResponse struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*HookResponse) Descriptor ¶
func (*HookResponse) Descriptor() ([]byte, []int)
func (*HookResponse) GetData ¶
func (m *HookResponse) GetData() []byte
func (*HookResponse) ProtoMessage ¶
func (*HookResponse) ProtoMessage()
func (*HookResponse) Reset ¶
func (m *HookResponse) Reset()
func (*HookResponse) String ¶
func (m *HookResponse) String() string
func (*HookResponse) XXX_DiscardUnknown ¶
func (m *HookResponse) XXX_DiscardUnknown()
func (*HookResponse) XXX_Marshal ¶
func (m *HookResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HookResponse) XXX_Merge ¶
func (m *HookResponse) XXX_Merge(src proto.Message)
func (*HookResponse) XXX_Size ¶
func (m *HookResponse) XXX_Size() int
func (*HookResponse) XXX_Unmarshal ¶
func (m *HookResponse) XXX_Unmarshal(b []byte) error
type InitRequest ¶
type InitRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*InitRequest) Descriptor ¶
func (*InitRequest) Descriptor() ([]byte, []int)
func (*InitRequest) ProtoMessage ¶
func (*InitRequest) ProtoMessage()
func (*InitRequest) Reset ¶
func (m *InitRequest) Reset()
func (*InitRequest) String ¶
func (m *InitRequest) String() string
func (*InitRequest) XXX_DiscardUnknown ¶
func (m *InitRequest) XXX_DiscardUnknown()
func (*InitRequest) XXX_Marshal ¶
func (m *InitRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*InitRequest) XXX_Merge ¶
func (m *InitRequest) XXX_Merge(src proto.Message)
func (*InitRequest) XXX_Size ¶
func (m *InitRequest) XXX_Size() int
func (*InitRequest) XXX_Unmarshal ¶
func (m *InitRequest) XXX_Unmarshal(b []byte) error
type PluginClient ¶
type PluginClient interface {
Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Registration, error)
DoHook(ctx context.Context, in *HookRequest, opts ...grpc.CallOption) (*HookResponse, error)
DoFilter(ctx context.Context, in *FilterData, opts ...grpc.CallOption) (*FilterData, error)
}
PluginClient is the client API for Plugin service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPluginClient ¶
func NewPluginClient(cc *grpc.ClientConn) PluginClient
type PluginServer ¶
type PluginServer interface {
Init(context.Context, *InitRequest) (*Registration, error)
DoHook(context.Context, *HookRequest) (*HookResponse, error)
DoFilter(context.Context, *FilterData) (*FilterData, error)
}
PluginServer is the server API for Plugin service.
type Registration ¶
type Registration struct {
// Name is the plugin's name, without any version information in it.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// ID is the plugin's unique identifier (within a plugins repository).
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
// Ver is the plugin's version.
Ver *version.Version `protobuf:"bytes,4,opt,name=ver,proto3" json:"ver,omitempty"`
// Specs contains the specifications within which the plugin works.
Specs []*Spec `protobuf:"bytes,5,rep,name=specs,proto3" json:"specs,omitempty"`
// Hooks is all of the hooks which the plugin wants to handle with its hook handlers.
Hooks map[string]*Handler `` /* 151-byte string literal not displayed */
// Filters is all of the filters which the plugin wants to handle with its filter handlers.
Filters map[string]*Handler `` /* 155-byte string literal not displayed */
// CustomHooks contains all of a plugin's custom defined hooks.
CustomHooks []string `protobuf:"bytes,8,rep,name=custom_hooks,json=customHooks,proto3" json:"custom_hooks,omitempty"`
// CustomFilters contains all of a plugin's custom defined filters.
CustomFilters []string `protobuf:"bytes,9,rep,name=custom_filters,json=customFilters,proto3" json:"custom_filters,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
A Registration contains all the information the system needs to register a plugin. This message type includes all of the fields you get by calling Identity on a plugins.Plugin instance, which together uniquely identifies a plugin at a particular version.
func (*Registration) Descriptor ¶
func (*Registration) Descriptor() ([]byte, []int)
func (*Registration) GetCustomFilters ¶
func (m *Registration) GetCustomFilters() []string
func (*Registration) GetCustomHooks ¶
func (m *Registration) GetCustomHooks() []string
func (*Registration) GetFilters ¶
func (m *Registration) GetFilters() map[string]*Handler
func (*Registration) GetHooks ¶
func (m *Registration) GetHooks() map[string]*Handler
func (*Registration) GetId ¶
func (m *Registration) GetId() string
func (*Registration) GetName ¶
func (m *Registration) GetName() string
func (*Registration) GetSpecs ¶
func (m *Registration) GetSpecs() []*Spec
func (*Registration) GetVer ¶
func (m *Registration) GetVer() *version.Version
func (*Registration) ProtoMessage ¶
func (*Registration) ProtoMessage()
func (*Registration) Reset ¶
func (m *Registration) Reset()
func (*Registration) String ¶
func (m *Registration) String() string
func (*Registration) XXX_DiscardUnknown ¶
func (m *Registration) XXX_DiscardUnknown()
func (*Registration) XXX_Marshal ¶
func (m *Registration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Registration) XXX_Merge ¶
func (m *Registration) XXX_Merge(src proto.Message)
func (*Registration) XXX_Size ¶
func (m *Registration) XXX_Size() int
func (*Registration) XXX_Unmarshal ¶
func (m *Registration) XXX_Unmarshal(b []byte) error
type Repository ¶
type Repository struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
RootUrl string `protobuf:"bytes,3,opt,name=root_url,json=rootUrl,proto3" json:"root_url,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Repository) Descriptor ¶
func (*Repository) Descriptor() ([]byte, []int)
func (*Repository) GetId ¶
func (m *Repository) GetId() string
func (*Repository) GetName ¶
func (m *Repository) GetName() string
func (*Repository) GetRootUrl ¶
func (m *Repository) GetRootUrl() string
func (*Repository) ProtoMessage ¶
func (*Repository) ProtoMessage()
func (*Repository) Reset ¶
func (m *Repository) Reset()
func (*Repository) String ¶
func (m *Repository) String() string
func (*Repository) XXX_DiscardUnknown ¶
func (m *Repository) XXX_DiscardUnknown()
func (*Repository) XXX_Marshal ¶
func (m *Repository) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Repository) XXX_Merge ¶
func (m *Repository) XXX_Merge(src proto.Message)
func (*Repository) XXX_Size ¶
func (m *Repository) XXX_Size() int
func (*Repository) XXX_Unmarshal ¶
func (m *Repository) XXX_Unmarshal(b []byte) error
type Spec ¶
type Spec struct {
// Type is the type of specification defined in this PluginSpec.
Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"`
// Value is the particular value for the spec type.
Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
A Spec contains a single specification by a plugin. This type is needed separately from the Spec type in the specs package because here the value must be an actual string, not a fmt.Stringer.
func (*Spec) Descriptor ¶
func (*Spec) ProtoMessage ¶
func (*Spec) ProtoMessage()
func (*Spec) XXX_DiscardUnknown ¶
func (m *Spec) XXX_DiscardUnknown()