Documentation ¶
Index ¶
- func AddAuthToken(ctx context.Context, req *http.Request) error
- func GetAPIClient(ctx context.Context) (*egapi.Client, error)
- func Redirect(path string) (*plugin_protos.Response, error)
- func WritePage(ctx context.Context, request *plugin_protos.Request, page Page) (*plugin_protos.Response, error)
- type Endpoint
- type Error
- type MenuItem
- type Page
- type Plugin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAuthToken ¶
AddAuthToken adds the auth token from the context to an outgoing request
func Redirect ¶
func Redirect(path string) (*plugin_protos.Response, error)
func WritePage ¶
func WritePage(ctx context.Context, request *plugin_protos.Request, page Page) (*plugin_protos.Response, error)
Types ¶
type Endpoint ¶
type Endpoint func(ctx context.Context, request *plugin_protos.Request) (*plugin_protos.Response, error)
type Error ¶
type Page ¶
type Page interface { Title() string StreamTitle(*quicktemplate.Writer) WriteTitle(io.Writer) Body() string StreamBody(*quicktemplate.Writer) WriteBody(io.Writer) }
type Plugin ¶
type Plugin struct { plugin_protos.UnimplementedPluginServiceServer Name string Extension string Endpoints map[string]map[string]Endpoint // map[path]map[method]Endpoint Menu *plugin_protos.MenuItem }
func (Plugin) HandleRequest ¶
func (p Plugin) HandleRequest(ctx context.Context, request *plugin_protos.Request) (*plugin_protos.Response, error)
func (Plugin) Settings ¶
func (p Plugin) Settings(ctx context.Context, _ *plugin_protos.Empty) (*plugin_protos.Plugin, error)
Click to show internal directories.
Click to hide internal directories.