doc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func EncodeFile

func EncodeFile(e Encoder, vf path.ValidFile) (b []byte, err error)

func EncodeTo

func EncodeTo(e Encoder, r io.Reader) (b []byte, err error)

func ExtensionToType

func ExtensionToType(ext string) (extType string, err error)

Types

type Bytes

type Bytes struct {
	Status
	// contains filtered or unexported fields
}

type CachedFileEncoder

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

func (*CachedFileEncoder) EncodeFile

func (c *CachedFileEncoder) EncodeFile(vf path.ValidFile) (s string, err error)

type Capture

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

func (Capture) Set

func (c Capture) Set()

type CaptureFn

type CaptureFn func()

type Doc

type Doc struct {
	Title string
	// contains filtered or unexported fields
}

func New

func New() (d Doc)

func (Doc) Base64Encoder

func (d Doc) Base64Encoder(args ...string) (le LoadEncoder)

func (Doc) Date

func (d Doc) Date() (s string)

func (Doc) DateWithFmt

func (d Doc) DateWithFmt(layout string) (s string)

func (Doc) Indices

func (_ Doc) Indices(stop int) (ind Indices)

func (Doc) NewFileLoader

func (_ Doc) NewFileLoader(args ...string) (l Loader)

func (Doc) NewPath

func (_ Doc) NewPath(args ...string) (p path.Path)

func (Doc) WithTitle

func (d Doc) WithTitle(title string) (D Doc)

type EncodeCache

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

func NewEncodeCache

func NewEncodeCache() (e EncodeCache)

func (*EncodeCache) Get

func (e *EncodeCache) Get(p path.ValidFile) (s string, ok bool)

func (*EncodeCache) Set

func (e *EncodeCache) Set(p path.ValidFile, s string)

func (EncodeCache) WithEncoder

func (e EncodeCache) WithEncoder(fe FileEncoder) (cf CachedFileEncoder)

type EncodedFiles

type EncodedFiles map[path.ValidFile]string

type Encoder

type Encoder interface {
	Encode(dst, src []byte)
	EncodedLen(n int) int
}

type ErrorHandler

type ErrorHandler interface {
	Handle(ctx *fasthttp.RequestCtx)
}

type ErrorTemplate

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

func NewErrorTemplate

func NewErrorTemplate(template *jet.Template) (e ErrorTemplate)

func (ErrorTemplate) NewHandler

func (et ErrorTemplate) NewHandler(h Handler) (eh ErrorTemplateHandler)

type ErrorTemplateHandler

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

func (ErrorTemplateHandler) Handle

func (e ErrorTemplateHandler) Handle(ctx *fasthttp.RequestCtx)

type FileEncoder

type FileEncoder interface {
	EncodeFile(vf path.ValidFile) (s string, err error)
}

func NoOpEncoder

func NoOpEncoder() (f FileEncoder)

type FuncMap

type FuncMap map[string]jet.Func

type Getter

type Getter interface {
	Get() error
}

type Handler

type Handler interface {
	Handle(*fasthttp.RequestCtx) error
}

type HtmlEncoder

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

func NewHtmlEncoder

func NewHtmlEncoder(enc Encoder) (h HtmlEncoder)

func (HtmlEncoder) EncodeFile

func (h HtmlEncoder) EncodeFile(vf path.ValidFile) (s string, err error)

type HtmlEncoderPlotly

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

func NewHtmlPlotlyEncoder

func NewHtmlPlotlyEncoder(enc Encoder) (p HtmlEncoderPlotly)

func (HtmlEncoderPlotly) EncodeFile

func (p HtmlEncoderPlotly) EncodeFile(vf path.ValidFile) (s string, err error)

type Indices

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

func (Indices) Iter

func (in Indices) Iter() (it *Iter)

func (Indices) Start

func (in Indices) Start(start int) (ind Indices)

func (Indices) Step

func (in Indices) Step(step int) (ind Indices)

func (Indices) Stop

func (in Indices) Stop(stop int) (ind Indices)

type Iter

type Iter struct {
	Indices
	// contains filtered or unexported fields
}

func (*Iter) Range

func (it *Iter) Range() (reflect.Value, reflect.Value, bool)

type LabelIndex

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

func NewLabels

func NewLabels() (li LabelIndex)

func (*LabelIndex) Add

func (li *LabelIndex) Add(key string)

func (*LabelIndex) AddIdx

func (li *LabelIndex) AddIdx(key string, idx int)

func (LabelIndex) Get

func (li LabelIndex) Get(key string) (idx int, err error)

func (LabelIndex) Iter

func (li LabelIndex) Iter() (d dict)

type LoadEncoder

type LoadEncoder struct {
	Loader
	// contains filtered or unexported fields
}

func (LoadEncoder) Encode

func (le LoadEncoder) Encode(args ...string) (str StringResult)

type Loader

type Loader struct {
	Status
	// contains filtered or unexported fields
}

func (Loader) Join

func (l Loader) Join(args ...string) (ll Loader)

func (Loader) Retreive

func (l Loader) Retreive(args ...string) (p Path)

func (Loader) WithEncoder

func (l Loader) WithEncoder(f FileEncoder) (le LoadEncoder)

type Mode

type Mode int
const (
	Localhost Mode = iota
)

type NoEncode

type NoEncode struct{}

func (NoEncode) EncodeFile

func (_ NoEncode) EncodeFile(vf path.ValidFile) (s string, err error)

type NoMatchingClass

type NoMatchingClass struct {
	Extension string
}

func (NoMatchingClass) Error

func (e NoMatchingClass) Error() (s string)

type Path

type Path struct {
	Status
	path.Valid
}

func (*Path) TryFrom

func (p *Path) TryFrom(systemPath path.Like)

type Port

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

func (*Port) Default

func (p *Port) Default()

func (Port) HostName

func (p Port) HostName() (s string)

func (Port) Localhost

func (p Port) Localhost() (address string)

func (Port) Prepend

func (p Port) Prepend(s string) (address string)

func (*Port) SetCli

func (p *Port) SetCli(c *cli.Cli)

type Render

type Render struct {
	Views *jet.Set
	// contains filtered or unexported fields
}

func (Render) Handle

func (r Render) Handle(ctx *fasthttp.RequestCtx) (err error)

type RenderBuilder

type RenderBuilder struct {
	Templates path.Dir
	// contains filtered or unexported fields
}

func NewRenderBuilder

func NewRenderBuilder() (r RenderBuilder)

func (*RenderBuilder) AddFunc

func (r *RenderBuilder) AddFunc(name string, f jet.Func)

func (RenderBuilder) Build

func (r RenderBuilder) Build() (rr Render)

func (*RenderBuilder) Default

func (r *RenderBuilder) Default()

func (*RenderBuilder) SetCli

func (r *RenderBuilder) SetCli(c *cli.Cli)

type Status

type Status struct {
	Err error
}

func (*Status) From

func (s *Status) From(g Getter) (b bool)

func (Status) Get

func (s Status) Get() (err error)

func (Status) IsErr

func (s Status) IsErr() (b bool)

func (*Status) Set

func (s *Status) Set(err error)

func (Status) Use

func (s Status) Use(err *error) CaptureFn

type String

type String string
const KeyError String = "key '%s' not found in LabelIndex"

func (String) Error

func (s String) Error() (ss string)

func (String) Format

func (s String) Format(args ...interface{}) (ss String)

type StringResult

type StringResult struct {
	Status
	// contains filtered or unexported fields
}

func OkString

func OkString(s string) (sr StringResult)

func (StringResult) String

func (str StringResult) String() (s string)

type Template

type Template interface {
	Execute(io.Writer, interface{}) error
}

type TemplateRender

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

func (*TemplateRender) Default

func (t *TemplateRender) Default()

func (TemplateRender) Run

func (t TemplateRender) Run() (err error)

func (*TemplateRender) SetCli

func (t *TemplateRender) SetCli(c *cli.Cli)

type TemplateServer

type TemplateServer struct {
	Port
	Builder RenderBuilder
	// contains filtered or unexported fields
}

func (*TemplateServer) Default

func (t *TemplateServer) Default()

func (TemplateServer) Run

func (ts TemplateServer) Run() (err error)

func (*TemplateServer) SetCli

func (ts *TemplateServer) SetCli(c *cli.Cli)

func (TemplateServer) Setup

func (ts TemplateServer) Setup() (r Render, rout *router.Router, err error)

type TemplateSet

type TemplateSet interface {
	GetTemplate(string) (Template, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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