grpcp

package
v0.0.0-...-545971b Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 31 Imported by: 4

Documentation

Overview

Package grpcp contains shared data between the host and plugins.

Index

Constants

This section is empty.

Variables

View Source
var Handshake = plugin.HandshakeConfig{
	ProtocolVersion:  1,
	MagicCookieKey:   "AMBIENT_PLUGIN",
	MagicCookieValue: "v1.0",
}

Handshake is a common handshake that is shared by plugin and host.

Functions

func ArrayToProtobufStruct

func ArrayToProtobufStruct(obj interface{}) ([]*structpb.Struct, error)

ArrayToProtobufStruct converts an array to a protobuf struct.

func ConnectPlugin

func ConnectPlugin(logger ambient.AppLogger, pluginName string, pluginPath string) (ambient.Plugin, *plugin.Client, plugin.ClientProtocol, error)

ConnectPlugin will connect to a plugin over gRPC.

func ErrorHandler

func ErrorHandler(err error) error

ErrorHandler returns a gRPC error if a gRPC problem or a regular error if not a gRPC error.

func InterfaceToProtobufAny

func InterfaceToProtobufAny(obj interface{}) (*anypb.Any, error)

InterfaceToProtobufAny converts an interface to a protobuf any.

func MapToProtobufStruct

func MapToProtobufStruct(obj map[string]interface{}) (*structpb.Struct, error)

MapToProtobufStruct converts a map to a protobuf struct.

func ObjectToProtobufStruct

func ObjectToProtobufStruct(obj interface{}) (*structpb.Struct, error)

ObjectToProtobufStruct converts an object to a protobuf struct.

func ProtobufAnyToInterface

func ProtobufAnyToInterface(s *anypb.Any, obj interface{}) error

ProtobufAnyToInterface converts a protobuf any to an interface.

func ProtobufStructToArray

func ProtobufStructToArray(s []*structpb.Struct, obj interface{}) error

ProtobufStructToArray converts a protobuf struct to an array.

func ProtobufStructToMap

func ProtobufStructToMap(s *structpb.Struct) map[string]interface{}

ProtobufStructToMap converts a map to a protobuf struct.

func ProtobufStructToObject

func ProtobufStructToObject(s *structpb.Struct, obj interface{}) error

ProtobufStructToObject converts a protobuf struct to an object.

Types

type FuncMapper

type FuncMapper interface {
	Do(globalFuncMap bool, requestID string, key string, args []interface{}, method string, path string, headers http.Header, body []byte) (value interface{}, errText string, err error)
}

FuncMapper handler.

type FuncMapperImpl

type FuncMapperImpl struct {
	Log         ambient.Logger
	Impl        ambient.MiddlewarePlugin
	PluginState *grpcsafe.PluginState
}

FuncMapperImpl handles the FuncMap logic.

func (*FuncMapperImpl) Do

func (d *FuncMapperImpl) Do(globalFuncMap bool, requestID string, key string, args []interface{}, method string, path string, headers http.Header, body []byte) (interface{}, string, error)

Do handler.

type GRPCAddRouterServer

type GRPCAddRouterServer struct {
	Impl ambient.Router
	Log  ambient.Logger

	HandlerClient *GRPCHandlerServer
	// contains filtered or unexported fields
}

GRPCAddRouterServer is the gRPC server that GRPCClient talks to.

func (*GRPCAddRouterServer) Delete

func (m *GRPCAddRouterServer) Delete(ctx context.Context, req *protodef.RouterRequest) (resp *protodef.Empty, err error)

Delete request handler.

func (*GRPCAddRouterServer) Error

Delete request handler.

func (*GRPCAddRouterServer) Get

Get request handler.

func (*GRPCAddRouterServer) Handle

func (m *GRPCAddRouterServer) Handle(ctx context.Context, req *protodef.RouterRequest) (resp *protodef.Empty, err error)

Handle request handler.

func (*GRPCAddRouterServer) Head

func (m *GRPCAddRouterServer) Head(ctx context.Context, req *protodef.RouterRequest) (resp *protodef.Empty, err error)

Head request handler.

func (*GRPCAddRouterServer) Options

func (m *GRPCAddRouterServer) Options(ctx context.Context, req *protodef.RouterRequest) (resp *protodef.Empty, err error)

Options request handler.

func (*GRPCAddRouterServer) Param

Param returns the named parameters.

func (*GRPCAddRouterServer) Patch

func (m *GRPCAddRouterServer) Patch(ctx context.Context, req *protodef.RouterRequest) (resp *protodef.Empty, err error)

Patch request handler.

func (*GRPCAddRouterServer) Post

func (m *GRPCAddRouterServer) Post(ctx context.Context, req *protodef.RouterRequest) (resp *protodef.Empty, err error)

Post request handler.

func (*GRPCAddRouterServer) Put

Put request handler.

type GRPCFuncMapperPlugin

type GRPCFuncMapperPlugin struct {
	Impl FuncMapper
	Log  ambient.Logger
}

GRPCFuncMapperPlugin is the gRPC server that GRPCClient talks to.

func (*GRPCFuncMapperPlugin) Do

Do handler.

type GRPCFuncMapperServer

type GRPCFuncMapperServer struct {
	Log ambient.Logger
	// contains filtered or unexported fields
}

GRPCFuncMapperServer handles server calls for FuncMap.

func (*GRPCFuncMapperServer) Do

func (l *GRPCFuncMapperServer) Do(r *http.Request, requestID string, key string, args []interface{}, globalFuncMap bool) (interface{}, string, error)

Do handler.

type GRPCHandlerPlugin

type GRPCHandlerPlugin struct {
	Impl Handler
	Log  ambient.Logger
}

GRPCHandlerPlugin is the gRPC server that GRPCClient talks to.

func (*GRPCHandlerPlugin) Handle

Handle .

type GRPCHandlerServer

type GRPCHandlerServer struct {
	// contains filtered or unexported fields
}

GRPCHandlerServer .

func (*GRPCHandlerServer) Handle

func (l *GRPCHandlerServer) Handle(method string, path string, r *http.Request, requestID string) (
	status int, errText string, response string, headers http.Header, err error)

Handle sends the request information from the server to the plugin.

type GRPCLoggerPlugin

type GRPCLoggerPlugin struct {
	// contains filtered or unexported fields
}

GRPCLoggerPlugin .

func (*GRPCLoggerPlugin) Debug

func (l *GRPCLoggerPlugin) Debug(format string, v ...interface{})

Debug handler.

func (*GRPCLoggerPlugin) Error

func (l *GRPCLoggerPlugin) Error(format string, v ...interface{})

Error handler.

func (*GRPCLoggerPlugin) Info

func (l *GRPCLoggerPlugin) Info(format string, v ...interface{})

Info handler.

func (*GRPCLoggerPlugin) Log

func (l *GRPCLoggerPlugin) Log(level ambient.LogLevel, format string, v ...interface{})

Log handler.

func (*GRPCLoggerPlugin) Warn

func (l *GRPCLoggerPlugin) Warn(format string, v ...interface{})

Warn handler.

type GRPCLoggerServer

type GRPCLoggerServer struct {
	Impl ambient.Logger
}

GRPCLoggerServer is the gRPC server that GRPCClient talks to.

func (*GRPCLoggerServer) Debug

func (m *GRPCLoggerServer) Debug(ctx context.Context, req *protodef.LogFormat) (resp *protodef.Empty, err error)

Debug -

func (*GRPCLoggerServer) Error

func (m *GRPCLoggerServer) Error(ctx context.Context, req *protodef.LogFormat) (resp *protodef.Empty, err error)

Error -

func (*GRPCLoggerServer) Info

func (m *GRPCLoggerServer) Info(ctx context.Context, req *protodef.LogFormat) (resp *protodef.Empty, err error)

Info -

func (*GRPCLoggerServer) Warn

func (m *GRPCLoggerServer) Warn(ctx context.Context, req *protodef.LogFormat) (resp *protodef.Empty, err error)

Warn -

type GRPCPlugin

type GRPCPlugin struct {
	Impl ambient.MiddlewarePlugin
	// contains filtered or unexported fields
}

GRPCPlugin is the plugin side implementation.

func (*GRPCPlugin) Assets

Assets handler.

func (*GRPCPlugin) Disable

func (m *GRPCPlugin) Disable(ctx context.Context, req *protodef.Empty) (*protodef.Empty, error)

Disable handler.

func (*GRPCPlugin) Enable

Enable handler.

func (*GRPCPlugin) FuncMap

FuncMap handler.

func (*GRPCPlugin) GrantRequests

func (m *GRPCPlugin) GrantRequests(ctx context.Context, req *protodef.Empty) (*protodef.GrantRequestsResponse, error)

GrantRequests handler.

func (*GRPCPlugin) Middleware

Middleware handler.

func (*GRPCPlugin) PluginName

PluginName handler.

func (*GRPCPlugin) PluginVersion

func (m *GRPCPlugin) PluginVersion(ctx context.Context, req *protodef.Empty) (*protodef.PluginVersionResponse, error)

PluginVersion handler.

func (*GRPCPlugin) Routes

func (m *GRPCPlugin) Routes(ctx context.Context, req *protodef.Empty) (*protodef.Empty, error)

Routes handler.

func (*GRPCPlugin) Settings

Settings handler.

type GRPCRendererPlugin

type GRPCRendererPlugin struct {
	Log         ambient.Logger
	PluginState *grpcsafe.PluginState
	// contains filtered or unexported fields
}

GRPCRendererPlugin .

func (*GRPCRendererPlugin) Error

func (l *GRPCRendererPlugin) Error(w http.ResponseWriter, r *http.Request, content string, statusCode int,
	fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)

Error handler.

func (*GRPCRendererPlugin) Page

func (l *GRPCRendererPlugin) Page(w http.ResponseWriter, r *http.Request, assets ambient.FileSystemReader, templateName string,
	fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)

Page handler.

func (*GRPCRendererPlugin) PageContent

func (l *GRPCRendererPlugin) PageContent(w http.ResponseWriter, r *http.Request, content string,
	fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)

PageContent handler.

func (*GRPCRendererPlugin) Post

func (l *GRPCRendererPlugin) Post(w http.ResponseWriter, r *http.Request, assets ambient.FileSystemReader, templateName string,
	fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)

Post handler.

func (*GRPCRendererPlugin) PostContent

func (l *GRPCRendererPlugin) PostContent(w http.ResponseWriter, r *http.Request, content string,
	fm func(r *http.Request) template.FuncMap, vars map[string]interface{}) (err error)

PostContent handler.

type GRPCRendererServer

type GRPCRendererServer struct {
	Log  ambient.Logger
	Impl ambient.Renderer

	FuncMapperClient *GRPCFuncMapperServer
	// contains filtered or unexported fields
}

GRPCRendererServer is the gRPC server that GRPCClient talks to.

func (*GRPCRendererServer) Error

Error handler.

func (*GRPCRendererServer) Page

Page handler.

func (*GRPCRendererServer) PageContent

PageContent handler.

func (*GRPCRendererServer) Post

Post handler.

func (*GRPCRendererServer) PostContent

PostContent handler.

type GRPCRouterPlugin

type GRPCRouterPlugin struct {
	Log         ambient.Logger
	PluginState *grpcsafe.PluginState
	// contains filtered or unexported fields
}

GRPCRouterPlugin .

func (*GRPCRouterPlugin) Delete

func (c *GRPCRouterPlugin) Delete(path string, fn func(http.ResponseWriter, *http.Request) (err error))

Delete request handler.

func (*GRPCRouterPlugin) Error

func (c *GRPCRouterPlugin) Error(status int, w http.ResponseWriter, r *http.Request)

Error handler.

func (*GRPCRouterPlugin) Get

func (c *GRPCRouterPlugin) Get(path string, fn func(http.ResponseWriter, *http.Request) (err error))

Get request handler.

func (*GRPCRouterPlugin) Handle

func (c *GRPCRouterPlugin) Handle(method string, path string, fn func(http.ResponseWriter, *http.Request) (err error))

Handle request handler.

func (*GRPCRouterPlugin) Head

func (c *GRPCRouterPlugin) Head(path string, fn func(http.ResponseWriter, *http.Request) (err error))

Head request handler.

func (*GRPCRouterPlugin) Options

func (c *GRPCRouterPlugin) Options(path string, fn func(http.ResponseWriter, *http.Request) (err error))

Options request handler.

func (*GRPCRouterPlugin) Param

func (c *GRPCRouterPlugin) Param(r *http.Request, name string) string

Param request handler.

func (*GRPCRouterPlugin) Patch

func (c *GRPCRouterPlugin) Patch(path string, fn func(http.ResponseWriter, *http.Request) (err error))

Patch request handler.

func (*GRPCRouterPlugin) Post

func (c *GRPCRouterPlugin) Post(path string, fn func(http.ResponseWriter, *http.Request) (err error))

Post request handler.

func (*GRPCRouterPlugin) Put

func (c *GRPCRouterPlugin) Put(path string, fn func(http.ResponseWriter, *http.Request) (err error))

Put request handler.

func (*GRPCRouterPlugin) StatusError

func (c *GRPCRouterPlugin) StatusError(status int, err error) error

StatusError handler.

func (*GRPCRouterPlugin) Wrap

func (c *GRPCRouterPlugin) Wrap(handler http.HandlerFunc) func(w http.ResponseWriter, r *http.Request) (err error)

Wrap for http.HandlerFunc.

type GRPCServer

type GRPCServer struct {
	// contains filtered or unexported fields
}

GRPCServer is the server side implementation.

func (*GRPCServer) Assets

func (m *GRPCServer) Assets() ([]ambient.Asset, ambient.FileSystemReader)

Assets handler.

func (*GRPCServer) Disable

func (m *GRPCServer) Disable() error

Disable handler.

func (*GRPCServer) Enable

func (m *GRPCServer) Enable(toolkit *ambient.Toolkit) error

Enable handler.

func (*GRPCServer) FuncMap

func (m *GRPCServer) FuncMap() func(r *http.Request) template.FuncMap

FuncMap handler.

func (*GRPCServer) GrantRequests

func (m *GRPCServer) GrantRequests() []ambient.GrantRequest

GrantRequests handler.

func (*GRPCServer) Middleware

func (m *GRPCServer) Middleware() []func(next http.Handler) http.Handler

Middleware handler.

func (*GRPCServer) PluginName

func (m *GRPCServer) PluginName() string

PluginName handler.

func (*GRPCServer) PluginVersion

func (m *GRPCServer) PluginVersion() string

PluginVersion handler.

func (*GRPCServer) Routes

func (m *GRPCServer) Routes()

Routes handler.

func (*GRPCServer) Settings

func (m *GRPCServer) Settings() []ambient.Setting

Settings handler.

type GRPCSitePlugin

type GRPCSitePlugin struct {
	Log ambient.Logger
	// contains filtered or unexported fields
}

GRPCSitePlugin is the plugin side implementation of secure site.

func (*GRPCSitePlugin) AuthenticatedUser

func (c *GRPCSitePlugin) AuthenticatedUser(r *http.Request) (string, error)

AuthenticatedUser handler.

func (*GRPCSitePlugin) Authorized

func (c *GRPCSitePlugin) Authorized(grant ambient.Grant) bool

Authorized handler.

func (*GRPCSitePlugin) CSRF

func (c *GRPCSitePlugin) CSRF(r *http.Request, token string) bool

CSRF handler.

func (*GRPCSitePlugin) Content

func (c *GRPCSitePlugin) Content() (string, error)

Content handler.

func (*GRPCSitePlugin) DeletePlugin

func (c *GRPCSitePlugin) DeletePlugin(pluginName string) error

DeletePlugin handler.

func (*GRPCSitePlugin) DeletePostByID

func (c *GRPCSitePlugin) DeletePostByID(ID string) error

DeletePostByID handler.

func (*GRPCSitePlugin) DeleteSessionValue

func (c *GRPCSitePlugin) DeleteSessionValue(r *http.Request, name string)

DeleteSessionValue handler.

func (*GRPCSitePlugin) DisablePlugin

func (c *GRPCSitePlugin) DisablePlugin(pluginName string, unloadPlugin bool) error

DisablePlugin handler.

func (*GRPCSitePlugin) EnablePlugin

func (c *GRPCSitePlugin) EnablePlugin(pluginName string, loadPlugin bool) error

EnablePlugin handler.

func (*GRPCSitePlugin) Error

func (c *GRPCSitePlugin) Error(siteError error) error

Error handler.

func (*GRPCSitePlugin) FullURL

func (c *GRPCSitePlugin) FullURL() (string, error)

FullURL handler.

func (*GRPCSitePlugin) Load

func (c *GRPCSitePlugin) Load() error

Load handler.

func (*GRPCSitePlugin) LoadSinglePluginPages

func (c *GRPCSitePlugin) LoadSinglePluginPages(name string)

LoadSinglePluginPages handler.

func (*GRPCSitePlugin) LogoutAllUsers

func (c *GRPCSitePlugin) LogoutAllUsers(r *http.Request) error

LogoutAllUsers handler.

func (*GRPCSitePlugin) NeighborPluginGrantList

func (c *GRPCSitePlugin) NeighborPluginGrantList(pluginName string) ([]ambient.GrantRequest, error)

NeighborPluginGrantList handler.

func (*GRPCSitePlugin) NeighborPluginGranted

func (c *GRPCSitePlugin) NeighborPluginGranted(pluginName string, grantName ambient.Grant) (bool, error)

NeighborPluginGranted handler.

func (*GRPCSitePlugin) NeighborPluginGrants

func (c *GRPCSitePlugin) NeighborPluginGrants(pluginName string) (map[ambient.Grant]bool, error)

NeighborPluginGrants handler.

func (*GRPCSitePlugin) NeighborPluginRequestedGrant

func (c *GRPCSitePlugin) NeighborPluginRequestedGrant(pluginName string, grantName ambient.Grant) (bool, error)

NeighborPluginRequestedGrant handler.

func (*GRPCSitePlugin) NeighborPluginSetting

func (c *GRPCSitePlugin) NeighborPluginSetting(pluginName string, fieldName string) (interface{}, error)

NeighborPluginSetting handler.

func (*GRPCSitePlugin) NeighborPluginSettingString

func (c *GRPCSitePlugin) NeighborPluginSettingString(pluginName string, fieldName string) (string, error)

NeighborPluginSettingString handler.

func (*GRPCSitePlugin) PluginNames

func (c *GRPCSitePlugin) PluginNames() ([]string, error)

PluginNames handler.

func (*GRPCSitePlugin) PluginNeighborRoutesList

func (c *GRPCSitePlugin) PluginNeighborRoutesList(pluginName string) ([]ambient.Route, error)

PluginNeighborRoutesList handler.

func (*GRPCSitePlugin) PluginNeighborSettingsList

func (c *GRPCSitePlugin) PluginNeighborSettingsList(pluginName string) ([]ambient.Setting, error)

PluginNeighborSettingsList handler.

func (*GRPCSitePlugin) PluginSetting

func (c *GRPCSitePlugin) PluginSetting(fieldName string) (interface{}, error)

PluginSetting handler.

func (*GRPCSitePlugin) PluginSettingBool

func (c *GRPCSitePlugin) PluginSettingBool(fieldName string) (bool, error)

PluginSettingBool handler.

func (*GRPCSitePlugin) PluginSettingString

func (c *GRPCSitePlugin) PluginSettingString(fieldName string) (string, error)

PluginSettingString handler.

func (*GRPCSitePlugin) PluginTrusted

func (c *GRPCSitePlugin) PluginTrusted(pluginName string) (bool, error)

PluginTrusted handler.

func (*GRPCSitePlugin) Plugins

func (c *GRPCSitePlugin) Plugins() (map[string]ambient.PluginData, error)

Plugins handler.

func (*GRPCSitePlugin) PostByID

func (c *GRPCSitePlugin) PostByID(ID string) (ambient.Post, error)

PostByID handler.

func (*GRPCSitePlugin) PostBySlug

func (c *GRPCSitePlugin) PostBySlug(slug string) (ambient.PostWithID, error)

PostBySlug handler.

func (*GRPCSitePlugin) PostsAndPages

func (c *GRPCSitePlugin) PostsAndPages(onlyPublished bool) (ambient.PostWithIDList, error)

PostsAndPages handler.

func (*GRPCSitePlugin) PublishedPages

func (c *GRPCSitePlugin) PublishedPages() ([]ambient.Post, error)

PublishedPages handler.

func (*GRPCSitePlugin) PublishedPosts

func (c *GRPCSitePlugin) PublishedPosts() ([]ambient.Post, error)

PublishedPosts handler.

func (*GRPCSitePlugin) SavePost

func (c *GRPCSitePlugin) SavePost(ID string, post ambient.Post) error

SavePost handler.

func (*GRPCSitePlugin) Scheme

func (c *GRPCSitePlugin) Scheme() (string, error)

Scheme handler.

func (*GRPCSitePlugin) SessionValue

func (c *GRPCSitePlugin) SessionValue(r *http.Request, name string) string

SessionValue handler.

func (*GRPCSitePlugin) SetCSRF

func (c *GRPCSitePlugin) SetCSRF(r *http.Request) string

SetCSRF handler.

func (*GRPCSitePlugin) SetContent

func (c *GRPCSitePlugin) SetContent(content string) error

SetContent handler.

func (*GRPCSitePlugin) SetNeighborPluginGrant

func (c *GRPCSitePlugin) SetNeighborPluginGrant(pluginName string, grantName ambient.Grant, granted bool) error

SetNeighborPluginGrant handler.

func (*GRPCSitePlugin) SetNeighborPluginSetting

func (c *GRPCSitePlugin) SetNeighborPluginSetting(pluginName string, settingName string, settingValue string) error

SetNeighborPluginSetting handler.

func (*GRPCSitePlugin) SetPluginSetting

func (c *GRPCSitePlugin) SetPluginSetting(settingName string, value string) error

SetPluginSetting handler.

func (*GRPCSitePlugin) SetScheme

func (c *GRPCSitePlugin) SetScheme(scheme string) error

SetScheme handler.

func (*GRPCSitePlugin) SetSessionValue

func (c *GRPCSitePlugin) SetSessionValue(r *http.Request, name string, value string) error

SetSessionValue handler.

func (*GRPCSitePlugin) SetTitle

func (c *GRPCSitePlugin) SetTitle(title string) error

SetTitle handler.

func (*GRPCSitePlugin) SetURL

func (c *GRPCSitePlugin) SetURL(URL string) error

SetURL handler.

func (*GRPCSitePlugin) Tags

func (c *GRPCSitePlugin) Tags(onlyPublished bool) (ambient.TagList, error)

Tags handler.

func (*GRPCSitePlugin) Title

func (c *GRPCSitePlugin) Title() (string, error)

Title handler.

func (*GRPCSitePlugin) URL

func (c *GRPCSitePlugin) URL() (string, error)

URL handler.

func (*GRPCSitePlugin) Updated

func (c *GRPCSitePlugin) Updated() (time.Time, error)

Updated handler.

func (*GRPCSitePlugin) UserLogin

func (c *GRPCSitePlugin) UserLogin(r *http.Request, username string) error

UserLogin handler.

func (*GRPCSitePlugin) UserLogout

func (c *GRPCSitePlugin) UserLogout(r *http.Request) error

UserLogout handler.

func (*GRPCSitePlugin) UserPersist

func (c *GRPCSitePlugin) UserPersist(r *http.Request, persist bool) error

UserPersist handler.

type GRPCSiteServer

type GRPCSiteServer struct {
	Impl ambient.SecureSite
	Log  ambient.Logger
	// contains filtered or unexported fields
}

GRPCSiteServer is the server side implementation of secure site.

func (*GRPCSiteServer) AuthenticatedUser

AuthenticatedUser handler.

func (*GRPCSiteServer) Authorized

Authorized handler.

func (*GRPCSiteServer) CSRF

CSRF handler.

func (*GRPCSiteServer) Content

func (m *GRPCSiteServer) Content(ctx context.Context, req *protodef.Empty) (resp *protodef.SiteContentResponse, err error)

Content handler.

func (*GRPCSiteServer) DeletePlugin

func (m *GRPCSiteServer) DeletePlugin(ctx context.Context, req *protodef.SiteDeletePluginRequest) (
	resp *protodef.Empty, err error)

DeletePlugin handler.

func (*GRPCSiteServer) DeletePostByID

func (m *GRPCSiteServer) DeletePostByID(ctx context.Context, req *protodef.SiteDeletePostByIDRequest) (
	resp *protodef.Empty, err error)

DeletePostByID handler.

func (*GRPCSiteServer) DeleteSessionValue

func (m *GRPCSiteServer) DeleteSessionValue(ctx context.Context, req *protodef.SiteDeleteSessionValueRequest) (resp *protodef.Empty, err error)

DeleteSessionValue handler.

func (*GRPCSiteServer) DisablePlugin

func (m *GRPCSiteServer) DisablePlugin(ctx context.Context, req *protodef.SiteDisablePluginRequest) (
	resp *protodef.Empty, err error)

DisablePlugin handler.

func (*GRPCSiteServer) EnablePlugin

func (m *GRPCSiteServer) EnablePlugin(ctx context.Context, req *protodef.SiteEnablePluginRequest) (
	resp *protodef.Empty, err error)

EnablePlugin handler.

func (*GRPCSiteServer) FullURL

func (m *GRPCSiteServer) FullURL(ctx context.Context, req *protodef.Empty) (resp *protodef.SiteFullURLResponse, err error)

FullURL handler.

func (*GRPCSiteServer) Load

func (m *GRPCSiteServer) Load(ctx context.Context, req *protodef.Empty) (resp *protodef.Empty, err error)

Load handler.

func (*GRPCSiteServer) LoadSinglePluginPages

func (m *GRPCSiteServer) LoadSinglePluginPages(ctx context.Context, req *protodef.SiteLoadSinglePluginPagesRequest) (resp *protodef.Empty, err error)

LoadSinglePluginPages handler.

func (*GRPCSiteServer) LogoutAllUsers

func (m *GRPCSiteServer) LogoutAllUsers(ctx context.Context, req *protodef.SiteLogoutAllUsersRequest) (resp *protodef.Empty, err error)

LogoutAllUsers handler.

func (*GRPCSiteServer) NeighborPluginGrantList

NeighborPluginGrantList handler.

func (*GRPCSiteServer) NeighborPluginGranted

NeighborPluginGranted handler.

func (*GRPCSiteServer) NeighborPluginGrants

NeighborPluginGrants handler.

func (*GRPCSiteServer) NeighborPluginRequestedGrant

NeighborPluginRequestedGrant handler.

func (*GRPCSiteServer) NeighborPluginSetting

NeighborPluginSetting handler.

func (*GRPCSiteServer) NeighborPluginSettingString

NeighborPluginSettingString handler.

func (*GRPCSiteServer) PluginNames

func (m *GRPCSiteServer) PluginNames(ctx context.Context, req *protodef.Empty) (
	resp *protodef.SitePluginNamesResponse, err error)

PluginNames handler.

func (*GRPCSiteServer) PluginNeighborRoutesList

PluginNeighborRoutesList handler.

func (*GRPCSiteServer) PluginNeighborSettingsList

PluginNeighborSettingsList handler.

func (*GRPCSiteServer) PluginSetting

PluginSetting handler.

func (*GRPCSiteServer) PluginSettingBool

PluginSettingBool handler.

func (*GRPCSiteServer) PluginSettingString

PluginSettingString handler.

func (*GRPCSiteServer) PluginTrusted

PluginTrusted handler.

func (*GRPCSiteServer) Plugins

func (m *GRPCSiteServer) Plugins(ctx context.Context, req *protodef.Empty) (
	resp *protodef.SitePluginsResponse, err error)

Plugins handler.

func (*GRPCSiteServer) PostByID

PostByID handler.

func (*GRPCSiteServer) PostBySlug

PostBySlug handler.

func (*GRPCSiteServer) PostsAndPages

PostsAndPages handler.

func (*GRPCSiteServer) PublishedPages

func (m *GRPCSiteServer) PublishedPages(ctx context.Context, req *protodef.Empty) (
	resp *protodef.SitePublishedPagesResponse, err error)

PublishedPages handler.

func (*GRPCSiteServer) PublishedPosts

func (m *GRPCSiteServer) PublishedPosts(ctx context.Context, req *protodef.Empty) (
	resp *protodef.SitePublishedPostsResponse, err error)

PublishedPosts handler.

func (*GRPCSiteServer) SavePost

func (m *GRPCSiteServer) SavePost(ctx context.Context, req *protodef.SiteSavePostRequest) (
	resp *protodef.Empty, err error)

SavePost handler.

func (*GRPCSiteServer) Scheme

func (m *GRPCSiteServer) Scheme(ctx context.Context, req *protodef.Empty) (resp *protodef.SiteSchemeResponse, err error)

Scheme handler.

func (*GRPCSiteServer) SessionValue

SessionValue handler.

func (*GRPCSiteServer) SetCSRF

SetCSRF handler.

func (*GRPCSiteServer) SetContent

func (m *GRPCSiteServer) SetContent(ctx context.Context, req *protodef.SiteSetContentRequest) (resp *protodef.Empty, err error)

SetContent handler.

func (*GRPCSiteServer) SetNeighborPluginGrant

func (m *GRPCSiteServer) SetNeighborPluginGrant(ctx context.Context, req *protodef.SiteSetNeighborPluginGrantRequest) (
	resp *protodef.Empty, err error)

SetNeighborPluginGrant handler.

func (*GRPCSiteServer) SetNeighborPluginSetting

func (m *GRPCSiteServer) SetNeighborPluginSetting(ctx context.Context, req *protodef.SiteSetNeighborPluginSettingRequest) (resp *protodef.Empty, err error)

SetNeighborPluginSetting handler.

func (*GRPCSiteServer) SetPluginSetting

func (m *GRPCSiteServer) SetPluginSetting(ctx context.Context, req *protodef.SiteSetPluginSettingRequest) (resp *protodef.Empty, err error)

SetPluginSetting handler.

func (*GRPCSiteServer) SetScheme

func (m *GRPCSiteServer) SetScheme(ctx context.Context, req *protodef.SiteSetSchemeRequest) (resp *protodef.Empty, err error)

SetScheme handler.

func (*GRPCSiteServer) SetSessionValue

func (m *GRPCSiteServer) SetSessionValue(ctx context.Context, req *protodef.SiteSetSessionValueRequest) (resp *protodef.Empty, err error)

SetSessionValue handler.

func (*GRPCSiteServer) SetTitle

func (m *GRPCSiteServer) SetTitle(ctx context.Context, req *protodef.SiteSetTitleRequest) (resp *protodef.Empty, err error)

SetTitle handler.

func (*GRPCSiteServer) SetURL

func (m *GRPCSiteServer) SetURL(ctx context.Context, req *protodef.SiteSetURLRequest) (resp *protodef.Empty, err error)

SetURL handler.

func (*GRPCSiteServer) Tags

Tags handler.

func (*GRPCSiteServer) Title

func (m *GRPCSiteServer) Title(ctx context.Context, req *protodef.Empty) (resp *protodef.SiteTitleResponse, err error)

Title handler.

func (*GRPCSiteServer) URL

func (m *GRPCSiteServer) URL(ctx context.Context, req *protodef.Empty) (resp *protodef.SiteURLResponse, err error)

URL handler.

func (*GRPCSiteServer) Updated

func (m *GRPCSiteServer) Updated(ctx context.Context, req *protodef.Empty) (resp *protodef.SiteUpdatedResponse, err error)

Updated handler.

func (*GRPCSiteServer) UserLogin

func (m *GRPCSiteServer) UserLogin(ctx context.Context, req *protodef.SiteUserLoginRequest) (resp *protodef.Empty, err error)

UserLogin handler.

func (*GRPCSiteServer) UserLogout

func (m *GRPCSiteServer) UserLogout(ctx context.Context, req *protodef.SiteUserLogoutRequest) (resp *protodef.Empty, err error)

UserLogout handler.

func (*GRPCSiteServer) UserPersist

func (m *GRPCSiteServer) UserPersist(ctx context.Context, req *protodef.SiteUserPersistRequest) (
	resp *protodef.Empty, err error)

UserPersist handler.

type GenericPlugin

type GenericPlugin struct {
	plugin.NetRPCUnsupportedPlugin
	Impl ambient.MiddlewarePlugin
}

GenericPlugin is the implementation of plugin. Plugin so we can serve/consume this. We also implement GRPCPlugin so that this plugin can be served over gRPC.

func (*GenericPlugin) GRPCClient

func (p *GenericPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error)

GRPCClient .

func (*GenericPlugin) GRPCServer

func (p *GenericPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error

GRPCServer .

type Handler

type Handler interface {
	Handle(requestID string, method string, path string, fullPath string, headers http.Header, body []byte) (status int, errorText string, response string, outHeaders http.Header)
}

Handler .

type HandlerImpl

type HandlerImpl struct {
	Log         ambient.Logger
	PluginState *grpcsafe.PluginState
}

HandlerImpl .

func (*HandlerImpl) Handle

func (d *HandlerImpl) Handle(requestid string, method string, path string, fullPath string, headers http.Header, body []byte) (int, string, string, http.Header)

Handle .

type MockHandler

type MockHandler struct {
	//W http.ResponseWriter
	R   *http.Request
	Log ambient.Logger
}

MockHandler is a mock mux.

func (*MockHandler) ServeHTTP

func (h *MockHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP stores the requests.

type ResponseWriter

type ResponseWriter struct {
	// contains filtered or unexported fields
}

ResponseWriter .

func NewResponseWriter

func NewResponseWriter() *ResponseWriter

NewResponseWriter .

func (*ResponseWriter) Header

func (w *ResponseWriter) Header() http.Header

Header .

func (*ResponseWriter) Output

func (w *ResponseWriter) Output() string

Output .

func (*ResponseWriter) StatusCode

func (w *ResponseWriter) StatusCode() int

StatusCode .

func (*ResponseWriter) Write

func (w *ResponseWriter) Write(b []byte) (int, error)

Write .

func (*ResponseWriter) WriteHeader

func (w *ResponseWriter) WriteHeader(statusCode int)

WriteHeader .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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