protoserver

package module
v0.0.0-...-008386d Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPScheme  = "http"
	HTTPSScheme = "https"
)
View Source
const FileScheme = "file"

Variables

This section is empty.

Functions

func Fetch

func Fetch(ctx context.Context, ref pk.Ref) (any, error)

func FetchBlob

func FetchBlob(ctx context.Context, ref pk.Ref) blob.Blob

func Register

func Register(s pk.Scheme, f Fetcher)

func RegisterFS

func RegisterFS(s pk.Scheme, fsys fs.FS)

func RegisterFile

func RegisterFile(cacheStorage blob.Storage)

func RegisterHTTP

func RegisterHTTP()

func RegisterHTTPS

func RegisterHTTPS()

func RegisterTemplate

func RegisterTemplate(s pk.Scheme, src fs.FS)

func RegisterTemplateFS

func RegisterTemplateFS(fsys fs.FS) error

Types

type FSNode

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

func (FSNode) Children

func (n FSNode) Children() ([]schema.RefNode, error)

func (FSNode) Files

func (n FSNode) Files() (map[string]schema.File, error)

func (FSNode) Open

func (n FSNode) Open() (io.ReadCloser, error)

func (FSNode) Ref

func (n FSNode) Ref() (pk.Ref, error)

type FetchFunc

type FetchFunc func(context.Context, pk.Ref) (any, error)

func (FetchFunc) Fetch

func (fn FetchFunc) Fetch(ctx context.Context, ref pk.Ref) (any, error)

type Fetcher

type Fetcher interface {
	Fetch(context.Context, pk.Ref) (any, error)
}

func Lookup

func Lookup(s pk.Scheme) Fetcher

func TransformFetcher

func TransformFetcher(fn TransformFunc) Fetcher

type TransformFunc

type TransformFunc func(ctx context.Context, params string, ref pk.Ref) (any, error)

Jump to

Keyboard shortcuts

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