grpcsafe

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetContainer

type AssetContainer struct {
	FuncMap template.FuncMap
	FS      ambient.FileSystemReader
}

AssetContainer contains a FuncMap and a virtual filesystem.

type HTTPContainer

type HTTPContainer struct {
	Request  *http.Request
	Response http.ResponseWriter
	FuncMap  template.FuncMap
}

HTTPContainer contains the request and response writer for a call.

type PluginState

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

PluginState contains state used by a plugin.

func NewPluginState

func NewPluginState() *PluginState

NewPluginState returns a thread safe plugin state object.

func (*PluginState) Assets

func (m *PluginState) Assets(requestID string) (*AssetContainer, bool)

Assets will return the assets.

func (*PluginState) Context

func (m *PluginState) Context(requestID string) (context.Context, bool)

Context will return the request context.

func (*PluginState) DeleteAssets

func (m *PluginState) DeleteAssets(requestID string)

DeleteAssets will delete the assets.

func (*PluginState) DeleteContextDelayed

func (m *PluginState) DeleteContextDelayed(requestID string)

DeleteContextDelayed will delete the request context after 30 seconds.

func (*PluginState) DeleteHandleMap

func (m *PluginState) DeleteHandleMap(requestID string)

DeleteHandleMap will delete the handle map.

func (*PluginState) HandleMap

func (m *PluginState) HandleMap(method string, path string) (func(http.ResponseWriter, *http.Request) error, bool)

HandleMap will return the handle map.

func (*PluginState) SaveAssets

func (m *PluginState) SaveAssets(c *AssetContainer, requestID string)

SaveAssets will save the request assets.

func (*PluginState) SaveContext

func (m *PluginState) SaveContext(c context.Context, requestID string)

SaveContext will save the request context.

func (*PluginState) SaveHandleMap

func (m *PluginState) SaveHandleMap(c func(http.ResponseWriter, *http.Request) error, method string, path string)

SaveHandleMap will save the handle map.

type ServerState

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

ServerState .

func NewServerState

func NewServerState() *ServerState

NewServerState .

func (*ServerState) Delete

func (m *ServerState) Delete(requestID string)

Delete .

func (*ServerState) Load

func (m *ServerState) Load(requestID string) *HTTPContainer

Load .

func (*ServerState) Save

func (m *ServerState) Save(requestID string, c *HTTPContainer)

Save .

Jump to

Keyboard shortcuts

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