plugin

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusSuccess = gemini.StatusSuccess
)

Variables

This section is empty.

Functions

func RegisterRoute added in v0.0.4

func RegisterRoute(route Route)

func Serve

func Serve()

Types

type BufferedResponseWriter added in v0.0.2

type BufferedResponseWriter struct {
	Mediatype string
	Status    gemini.Status
	Meta      string
	Data      []byte
}

func NewBufferedResponseWriter added in v0.0.2

func NewBufferedResponseWriter() *BufferedResponseWriter

func (*BufferedResponseWriter) Flush added in v0.0.2

func (w *BufferedResponseWriter) Flush() error

func (*BufferedResponseWriter) SetMediaType added in v0.0.2

func (w *BufferedResponseWriter) SetMediaType(mediatype string)

func (*BufferedResponseWriter) Write added in v0.0.2

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

func (*BufferedResponseWriter) WriteHeader added in v0.0.2

func (w *BufferedResponseWriter) WriteHeader(status gemini.Status, meta string)

type HandshakeConfig

type HandshakeConfig = plugin.HandshakeConfig

type Plugin

type Plugin = plugin.Plugin

type Request

type Request = gemini.Request

type ResponseWriter

type ResponseWriter = gemini.ResponseWriter

type ResponseWriterImpl added in v0.0.2

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

type Route

type Route interface {
	ServeGemini(ctx context.Context, w ResponseWriter, r *Request)
}

Implementation

type RoutePlugin

type RoutePlugin struct {
	// Impl Injection
	Impl RouteReceiver
}

Plugin implmentation

func NewRoutePlugin added in v0.0.2

func NewRoutePlugin(impl Route) *RoutePlugin

func (RoutePlugin) Client

func (RoutePlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*RoutePlugin) Server

func (p *RoutePlugin) Server(*plugin.MuxBroker) (interface{}, error)

type RouteRPC

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

Here is an implementation that talks over RPC

func (*RouteRPC) ServeGemini

func (r *RouteRPC) ServeGemini(rr RouteRequest) BufferedResponseWriter

type RouteRPCServer

type RouteRPCServer struct {
	Impl RouteReceiver
}

func (*RouteRPCServer) ServeGemini

func (s *RouteRPCServer) ServeGemini(args RouteRequest, resp *BufferedResponseWriter) error

type RouteReceiver added in v0.0.2

type RouteReceiver interface {
	ServeGemini(RouteRequest) BufferedResponseWriter
}

type RouteReceiverImpl added in v0.0.2

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

func (*RouteReceiverImpl) ServeGemini added in v0.0.2

type RouteRequest added in v0.0.2

type RouteRequest struct {
	URL string
}

type ServeConfig

type ServeConfig = plugin.ServeConfig

type Status

type Status = gemini.Status

Directories

Path Synopsis
plugintest

Jump to

Keyboard shortcuts

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