errata

package module
v0.1.1 Latest Latest
Warning

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

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

README

errata

errata is a general purpose, language-agnostic toolkit for error code enumeration (ECE).

ECE is the process of defining all the ways in which your software can fail. Think of it as negative documentation (describing how your system fails as opposed to how it works).

Consider a web application. Aren't HTTP status codes enough? No. They are sometimes useful (404 Not Found is fairly clear), but others are so vague as to be pretty meaningless (500 Internal Server Error). Often an additional semantic layer is required to communicate what exactly went wrong, and what the caller (be they a human, an API client, etc) can do in response. HTTP status codes are perfect for describing the category of problem (4xx client error, 5xx server error), but insufficient for the complex software of today.

Major API vendors such as Twilio, Instagram, and Google Cloud recognise this and use ECE in some form. errata aims to provide a mechanism for any software to deliver world-class error handling.

Basic Concepts

errata's philosophy is that errors should have at least a static error code and a human-readable message.

  • the code is searchable, and because it's static it becomes more easily searchable
  • the message is displayed to the user alongside the code, to provide immediate context, and ideally to give an insight into what went wrong

Besides the basic code and message, including other valuable metadata like a unique reference (particularly useful in SaaS applications), labels, user guides, etc can be included.

Definitions

errata uses the HCL structured configuration language, used primarily by Terraform. It's extensible, simple to read and write, and frankly - fuck YAML.

version = "0.1"

error "file-not-found" {
  message    = "File path is incorrect or inaccessible"
  categories = ["file"]
  guide      = "Ensure the given file exists and can be accessed"
  args       = [
    arg("path", "string")
  ]
  labels     = {
    severity = "warn"
  }
}

...

The above example defines the code (file-not-found) and the message, along with some other useful metadata (more on this below).

So, what can this definitions file be used for?

Code Generation

errata provides a language-agnostic mechanism for generating code based on these definitions using the Pongo2 templating engine.

errata comes with a CLI tool called eish (errata interactive shell, pronounced "eɪʃ") which generates code based on given errata definitions.

$ eish generate --source=errata.hcl --template=golang --package=errors

This will generate a single file with all error definitions. See the sample application which uses errata definitions (and rather recursively, the errata library also uses errata definitions).

Web UI

eish also provides a simple web UI, allowing your errata definitions to be viewed and searched.

$ eish serve --source=errata.hcl

The web UI by default runs on port 37707.

Web UI

Supported Languages

If your language of choice is not yet available, consider contributing a template!

errata uses the Pongo2 templating engine

  • Golang (reference implementation)

The code produced by errata aims to be:

  • idiomatic
  • easy to use
  • using native error/exception types as much as possible

Documentation

Overview

Package errata is auto-generated by errata Errata Schema Version: 0.1 Hash: 9f2e70162ab7eeef16b15ac74b8f1ad2

Index

Constants

View Source
const (
	ArgumentLabelNameClashErrCode string = "errata-argument-label-name-clash"
	CodeGenErrCode                string = "errata-code-gen"
	FileNotFoundErrCode           string = "errata-file-not-found"
	FileNotReadableErrCode        string = "errata-file-not-readable"
	InvalidDatasourceErrCode      string = "errata-invalid-datasource"
	InvalidDefinitionsErrCode     string = "errata-invalid-definitions"
	InvalidSyntaxErrCode          string = "errata-invalid-syntax"
	MarkdownRenderingErrCode      string = "errata-markdown-rendering"
	ServeMethodNotAllowedErrCode  string = "errata-serve-method-not-allowed"
	ServeSearchIndexErrCode       string = "errata-serve-search-index"
	ServeSearchMissingTermErrCode string = "errata-serve-search-missing-term"
	ServeUnknownCodeErrCode       string = "errata-serve-unknown-code"
	ServeUnknownRouteErrCode      string = "errata-serve-unknown-route"
	ServeWebUiErrCode             string = "errata-serve-web-ui"
	TemplateExecutionErrCode      string = "errata-template-execution"
)

Variables

This section is empty.

Functions

func Generate

func Generate(data CodeGenConfig, w io.Writer) error

func LogError

func LogError(err error, args ...interface{})

func Serve

func Serve(srv *Server) error

Types

type ArgumentLabelNameClashErr

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

func NewArgumentLabelNameClashErr

func NewArgumentLabelNameClashErr(wrapped error, key string) *ArgumentLabelNameClashErr

func (*ArgumentLabelNameClashErr) Args

func (e *ArgumentLabelNameClashErr) Args() map[string]interface{}

func (*ArgumentLabelNameClashErr) Categories

func (e *ArgumentLabelNameClashErr) Categories() []string

func (*ArgumentLabelNameClashErr) Code

func (e *ArgumentLabelNameClashErr) Code() string

func (*ArgumentLabelNameClashErr) Error

func (e *ArgumentLabelNameClashErr) Error() string

func (*ArgumentLabelNameClashErr) File

func (e *ArgumentLabelNameClashErr) File() string

func (*ArgumentLabelNameClashErr) Format

func (e *ArgumentLabelNameClashErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*ArgumentLabelNameClashErr) GetKey

func (e *ArgumentLabelNameClashErr) GetKey() interface{}

GetKey returns the "key" argument for a ArgumentLabelNameClashErr instance.

func (*ArgumentLabelNameClashErr) GetSeverity

func (e *ArgumentLabelNameClashErr) GetSeverity() string

GetSeverity returns the "severity" label for a ArgumentLabelNameClashErr instance.

func (*ArgumentLabelNameClashErr) Guide

func (e *ArgumentLabelNameClashErr) Guide() string

func (*ArgumentLabelNameClashErr) HelpURL

func (e *ArgumentLabelNameClashErr) HelpURL() string

func (*ArgumentLabelNameClashErr) Labels

func (e *ArgumentLabelNameClashErr) Labels() map[string]string

func (*ArgumentLabelNameClashErr) Line

func (e *ArgumentLabelNameClashErr) Line() int

func (*ArgumentLabelNameClashErr) Message

func (e *ArgumentLabelNameClashErr) Message() string

func (*ArgumentLabelNameClashErr) UUID

func (e *ArgumentLabelNameClashErr) UUID() string

func (*ArgumentLabelNameClashErr) Unwrap

func (e *ArgumentLabelNameClashErr) Unwrap() error

type CodeGenConfig

type CodeGenConfig struct {
	Source   string
	Template string
	Package  string
}

type CodeGenErr

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

func NewCodeGenErr

func NewCodeGenErr(wrapped error) *CodeGenErr

func (*CodeGenErr) Args

func (e *CodeGenErr) Args() map[string]interface{}

func (*CodeGenErr) Categories

func (e *CodeGenErr) Categories() []string

func (*CodeGenErr) Code

func (e *CodeGenErr) Code() string

func (*CodeGenErr) Error

func (e *CodeGenErr) Error() string

func (*CodeGenErr) File

func (e *CodeGenErr) File() string

func (*CodeGenErr) Format

func (e *CodeGenErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*CodeGenErr) GetSeverity

func (e *CodeGenErr) GetSeverity() string

GetSeverity returns the "severity" label for a CodeGenErr instance.

func (*CodeGenErr) Guide

func (e *CodeGenErr) Guide() string

func (*CodeGenErr) HelpURL

func (e *CodeGenErr) HelpURL() string

func (*CodeGenErr) Labels

func (e *CodeGenErr) Labels() map[string]string

func (*CodeGenErr) Line

func (e *CodeGenErr) Line() int

func (*CodeGenErr) Message

func (e *CodeGenErr) Message() string

func (*CodeGenErr) UUID

func (e *CodeGenErr) UUID() string

func (*CodeGenErr) Unwrap

func (e *CodeGenErr) Unwrap() error

type DataSource

type DataSource interface {
	List() map[string]errorDefinition
	Options() errorOptions
	// FindByCode looks up an Erratum by a given code and is guaranteed to return an errorDefinition.
	// However, if the code cannot be found, an errorDefinition will be crated with just the given code
	// and false will be returned as the second return value
	FindByCode(code string) (errorDefinition, bool)
	Validate() error
	// Hash returns the hashed contents of the given datasource, to detect drift
	Hash() string
	// SchemaVersion returns the schema version of the given datasource
	SchemaVersion() string
}

func NewHCLDatasource

func NewHCLDatasource(path string) (DataSource, error)

type Erratum

type Erratum interface {
	// behave like a regular error
	error
	Unwrap() error

	Code() string
	Message() string
	Categories() []string
	Args() map[string]interface{}
	Guide() string
	Labels() map[string]string

	UUID() string
	HelpURL() string
}

Erratum is the public interface which indicates that a given error is an Erratum.

type FileNotFoundErr

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

func NewFileNotFoundErr

func NewFileNotFoundErr(wrapped error, path string) *FileNotFoundErr

func (*FileNotFoundErr) Args

func (e *FileNotFoundErr) Args() map[string]interface{}

func (*FileNotFoundErr) Categories

func (e *FileNotFoundErr) Categories() []string

func (*FileNotFoundErr) Code

func (e *FileNotFoundErr) Code() string

func (*FileNotFoundErr) Error

func (e *FileNotFoundErr) Error() string

func (*FileNotFoundErr) File

func (e *FileNotFoundErr) File() string

func (*FileNotFoundErr) Format

func (e *FileNotFoundErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*FileNotFoundErr) GetPath

func (e *FileNotFoundErr) GetPath() interface{}

GetPath returns the "path" argument for a FileNotFoundErr instance.

func (*FileNotFoundErr) GetSeverity

func (e *FileNotFoundErr) GetSeverity() string

GetSeverity returns the "severity" label for a FileNotFoundErr instance.

func (*FileNotFoundErr) Guide

func (e *FileNotFoundErr) Guide() string

func (*FileNotFoundErr) HelpURL

func (e *FileNotFoundErr) HelpURL() string

func (*FileNotFoundErr) Labels

func (e *FileNotFoundErr) Labels() map[string]string

func (*FileNotFoundErr) Line

func (e *FileNotFoundErr) Line() int

func (*FileNotFoundErr) Message

func (e *FileNotFoundErr) Message() string

func (*FileNotFoundErr) UUID

func (e *FileNotFoundErr) UUID() string

func (*FileNotFoundErr) Unwrap

func (e *FileNotFoundErr) Unwrap() error

type FileNotReadableErr

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

func NewFileNotReadableErr

func NewFileNotReadableErr(wrapped error, path string) *FileNotReadableErr

func (*FileNotReadableErr) Args

func (e *FileNotReadableErr) Args() map[string]interface{}

func (*FileNotReadableErr) Categories

func (e *FileNotReadableErr) Categories() []string

func (*FileNotReadableErr) Code

func (e *FileNotReadableErr) Code() string

func (*FileNotReadableErr) Error

func (e *FileNotReadableErr) Error() string

func (*FileNotReadableErr) File

func (e *FileNotReadableErr) File() string

func (*FileNotReadableErr) Format

func (e *FileNotReadableErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*FileNotReadableErr) GetPath

func (e *FileNotReadableErr) GetPath() interface{}

GetPath returns the "path" argument for a FileNotReadableErr instance.

func (*FileNotReadableErr) GetSeverity

func (e *FileNotReadableErr) GetSeverity() string

GetSeverity returns the "severity" label for a FileNotReadableErr instance.

func (*FileNotReadableErr) Guide

func (e *FileNotReadableErr) Guide() string

func (*FileNotReadableErr) HelpURL

func (e *FileNotReadableErr) HelpURL() string

func (*FileNotReadableErr) Labels

func (e *FileNotReadableErr) Labels() map[string]string

func (*FileNotReadableErr) Line

func (e *FileNotReadableErr) Line() int

func (*FileNotReadableErr) Message

func (e *FileNotReadableErr) Message() string

func (*FileNotReadableErr) UUID

func (e *FileNotReadableErr) UUID() string

func (*FileNotReadableErr) Unwrap

func (e *FileNotReadableErr) Unwrap() error

type HTTPStatusCodeExtractor

type HTTPStatusCodeExtractor interface {
	GetHttpStatusCode() string
}

type InvalidDatasourceErr

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

func NewInvalidDatasourceErr

func NewInvalidDatasourceErr(wrapped error, path string) *InvalidDatasourceErr

func (*InvalidDatasourceErr) Args

func (e *InvalidDatasourceErr) Args() map[string]interface{}

func (*InvalidDatasourceErr) Categories

func (e *InvalidDatasourceErr) Categories() []string

func (*InvalidDatasourceErr) Code

func (e *InvalidDatasourceErr) Code() string

func (*InvalidDatasourceErr) Error

func (e *InvalidDatasourceErr) Error() string

func (*InvalidDatasourceErr) File

func (e *InvalidDatasourceErr) File() string

func (*InvalidDatasourceErr) Format

func (e *InvalidDatasourceErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*InvalidDatasourceErr) GetPath

func (e *InvalidDatasourceErr) GetPath() interface{}

GetPath returns the "path" argument for a InvalidDatasourceErr instance.

func (*InvalidDatasourceErr) GetSeverity

func (e *InvalidDatasourceErr) GetSeverity() string

GetSeverity returns the "severity" label for a InvalidDatasourceErr instance.

func (*InvalidDatasourceErr) Guide

func (e *InvalidDatasourceErr) Guide() string

func (*InvalidDatasourceErr) HelpURL

func (e *InvalidDatasourceErr) HelpURL() string

func (*InvalidDatasourceErr) Labels

func (e *InvalidDatasourceErr) Labels() map[string]string

func (*InvalidDatasourceErr) Line

func (e *InvalidDatasourceErr) Line() int

func (*InvalidDatasourceErr) Message

func (e *InvalidDatasourceErr) Message() string

func (*InvalidDatasourceErr) UUID

func (e *InvalidDatasourceErr) UUID() string

func (*InvalidDatasourceErr) Unwrap

func (e *InvalidDatasourceErr) Unwrap() error

type InvalidDefinitionsErr

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

func NewInvalidDefinitionsErr

func NewInvalidDefinitionsErr(wrapped error, path string) *InvalidDefinitionsErr

func (*InvalidDefinitionsErr) Args

func (e *InvalidDefinitionsErr) Args() map[string]interface{}

func (*InvalidDefinitionsErr) Categories

func (e *InvalidDefinitionsErr) Categories() []string

func (*InvalidDefinitionsErr) Code

func (e *InvalidDefinitionsErr) Code() string

func (*InvalidDefinitionsErr) Error

func (e *InvalidDefinitionsErr) Error() string

func (*InvalidDefinitionsErr) File

func (e *InvalidDefinitionsErr) File() string

func (*InvalidDefinitionsErr) Format

func (e *InvalidDefinitionsErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*InvalidDefinitionsErr) GetPath

func (e *InvalidDefinitionsErr) GetPath() interface{}

GetPath returns the "path" argument for a InvalidDefinitionsErr instance.

func (*InvalidDefinitionsErr) GetSeverity

func (e *InvalidDefinitionsErr) GetSeverity() string

GetSeverity returns the "severity" label for a InvalidDefinitionsErr instance.

func (*InvalidDefinitionsErr) Guide

func (e *InvalidDefinitionsErr) Guide() string

func (*InvalidDefinitionsErr) HelpURL

func (e *InvalidDefinitionsErr) HelpURL() string

func (*InvalidDefinitionsErr) Labels

func (e *InvalidDefinitionsErr) Labels() map[string]string

func (*InvalidDefinitionsErr) Line

func (e *InvalidDefinitionsErr) Line() int

func (*InvalidDefinitionsErr) Message

func (e *InvalidDefinitionsErr) Message() string

func (*InvalidDefinitionsErr) UUID

func (e *InvalidDefinitionsErr) UUID() string

func (*InvalidDefinitionsErr) Unwrap

func (e *InvalidDefinitionsErr) Unwrap() error

type InvalidSyntaxErr

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

func NewInvalidSyntaxErr

func NewInvalidSyntaxErr(wrapped error, path string) *InvalidSyntaxErr

func (*InvalidSyntaxErr) Args

func (e *InvalidSyntaxErr) Args() map[string]interface{}

func (*InvalidSyntaxErr) Categories

func (e *InvalidSyntaxErr) Categories() []string

func (*InvalidSyntaxErr) Code

func (e *InvalidSyntaxErr) Code() string

func (*InvalidSyntaxErr) Error

func (e *InvalidSyntaxErr) Error() string

func (*InvalidSyntaxErr) File

func (e *InvalidSyntaxErr) File() string

func (*InvalidSyntaxErr) Format

func (e *InvalidSyntaxErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*InvalidSyntaxErr) GetPath

func (e *InvalidSyntaxErr) GetPath() interface{}

GetPath returns the "path" argument for a InvalidSyntaxErr instance.

func (*InvalidSyntaxErr) GetSeverity

func (e *InvalidSyntaxErr) GetSeverity() string

GetSeverity returns the "severity" label for a InvalidSyntaxErr instance.

func (*InvalidSyntaxErr) Guide

func (e *InvalidSyntaxErr) Guide() string

func (*InvalidSyntaxErr) HelpURL

func (e *InvalidSyntaxErr) HelpURL() string

func (*InvalidSyntaxErr) Labels

func (e *InvalidSyntaxErr) Labels() map[string]string

func (*InvalidSyntaxErr) Line

func (e *InvalidSyntaxErr) Line() int

func (*InvalidSyntaxErr) Message

func (e *InvalidSyntaxErr) Message() string

func (*InvalidSyntaxErr) UUID

func (e *InvalidSyntaxErr) UUID() string

func (*InvalidSyntaxErr) Unwrap

func (e *InvalidSyntaxErr) Unwrap() error

type LogLevel

type LogLevel interface {
	Erratum
	GetLogLevel() string
}

type MarkdownRenderingErr

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

func NewMarkdownRenderingErr

func NewMarkdownRenderingErr(wrapped error) *MarkdownRenderingErr

func (*MarkdownRenderingErr) Args

func (e *MarkdownRenderingErr) Args() map[string]interface{}

func (*MarkdownRenderingErr) Categories

func (e *MarkdownRenderingErr) Categories() []string

func (*MarkdownRenderingErr) Code

func (e *MarkdownRenderingErr) Code() string

func (*MarkdownRenderingErr) Error

func (e *MarkdownRenderingErr) Error() string

func (*MarkdownRenderingErr) File

func (e *MarkdownRenderingErr) File() string

func (*MarkdownRenderingErr) Format

func (e *MarkdownRenderingErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*MarkdownRenderingErr) GetSeverity

func (e *MarkdownRenderingErr) GetSeverity() string

GetSeverity returns the "severity" label for a MarkdownRenderingErr instance.

func (*MarkdownRenderingErr) Guide

func (e *MarkdownRenderingErr) Guide() string

func (*MarkdownRenderingErr) HelpURL

func (e *MarkdownRenderingErr) HelpURL() string

func (*MarkdownRenderingErr) Labels

func (e *MarkdownRenderingErr) Labels() map[string]string

func (*MarkdownRenderingErr) Line

func (e *MarkdownRenderingErr) Line() int

func (*MarkdownRenderingErr) Message

func (e *MarkdownRenderingErr) Message() string

func (*MarkdownRenderingErr) UUID

func (e *MarkdownRenderingErr) UUID() string

func (*MarkdownRenderingErr) Unwrap

func (e *MarkdownRenderingErr) Unwrap() error

type ServeMethodNotAllowedErr

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

func NewServeMethodNotAllowedErr

func NewServeMethodNotAllowedErr(wrapped error, route string, method string) *ServeMethodNotAllowedErr

func (*ServeMethodNotAllowedErr) Args

func (e *ServeMethodNotAllowedErr) Args() map[string]interface{}

func (*ServeMethodNotAllowedErr) Categories

func (e *ServeMethodNotAllowedErr) Categories() []string

func (*ServeMethodNotAllowedErr) Code

func (e *ServeMethodNotAllowedErr) Code() string

func (*ServeMethodNotAllowedErr) Error

func (e *ServeMethodNotAllowedErr) Error() string

func (*ServeMethodNotAllowedErr) File

func (e *ServeMethodNotAllowedErr) File() string

func (*ServeMethodNotAllowedErr) Format

func (e *ServeMethodNotAllowedErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*ServeMethodNotAllowedErr) GetMethod

func (e *ServeMethodNotAllowedErr) GetMethod() interface{}

GetMethod returns the "method" argument for a ServeMethodNotAllowedErr instance.

func (*ServeMethodNotAllowedErr) GetRoute

func (e *ServeMethodNotAllowedErr) GetRoute() interface{}

GetRoute returns the "route" argument for a ServeMethodNotAllowedErr instance.

func (*ServeMethodNotAllowedErr) GetSeverity

func (e *ServeMethodNotAllowedErr) GetSeverity() string

GetSeverity returns the "severity" label for a ServeMethodNotAllowedErr instance.

func (*ServeMethodNotAllowedErr) Guide

func (e *ServeMethodNotAllowedErr) Guide() string

func (*ServeMethodNotAllowedErr) HelpURL

func (e *ServeMethodNotAllowedErr) HelpURL() string

func (*ServeMethodNotAllowedErr) Labels

func (e *ServeMethodNotAllowedErr) Labels() map[string]string

func (*ServeMethodNotAllowedErr) Line

func (e *ServeMethodNotAllowedErr) Line() int

func (*ServeMethodNotAllowedErr) Message

func (e *ServeMethodNotAllowedErr) Message() string

func (*ServeMethodNotAllowedErr) UUID

func (e *ServeMethodNotAllowedErr) UUID() string

func (*ServeMethodNotAllowedErr) Unwrap

func (e *ServeMethodNotAllowedErr) Unwrap() error

type ServeSearchIndexErr

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

func NewServeSearchIndexErr

func NewServeSearchIndexErr(wrapped error) *ServeSearchIndexErr

func (*ServeSearchIndexErr) Args

func (e *ServeSearchIndexErr) Args() map[string]interface{}

func (*ServeSearchIndexErr) Categories

func (e *ServeSearchIndexErr) Categories() []string

func (*ServeSearchIndexErr) Code

func (e *ServeSearchIndexErr) Code() string

func (*ServeSearchIndexErr) Error

func (e *ServeSearchIndexErr) Error() string

func (*ServeSearchIndexErr) File

func (e *ServeSearchIndexErr) File() string

func (*ServeSearchIndexErr) Format

func (e *ServeSearchIndexErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*ServeSearchIndexErr) GetSeverity

func (e *ServeSearchIndexErr) GetSeverity() string

GetSeverity returns the "severity" label for a ServeSearchIndexErr instance.

func (*ServeSearchIndexErr) Guide

func (e *ServeSearchIndexErr) Guide() string

func (*ServeSearchIndexErr) HelpURL

func (e *ServeSearchIndexErr) HelpURL() string

func (*ServeSearchIndexErr) Labels

func (e *ServeSearchIndexErr) Labels() map[string]string

func (*ServeSearchIndexErr) Line

func (e *ServeSearchIndexErr) Line() int

func (*ServeSearchIndexErr) Message

func (e *ServeSearchIndexErr) Message() string

func (*ServeSearchIndexErr) UUID

func (e *ServeSearchIndexErr) UUID() string

func (*ServeSearchIndexErr) Unwrap

func (e *ServeSearchIndexErr) Unwrap() error

type ServeSearchMissingTermErr

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

func NewServeSearchMissingTermErr

func NewServeSearchMissingTermErr(wrapped error) *ServeSearchMissingTermErr

func (*ServeSearchMissingTermErr) Args

func (e *ServeSearchMissingTermErr) Args() map[string]interface{}

func (*ServeSearchMissingTermErr) Categories

func (e *ServeSearchMissingTermErr) Categories() []string

func (*ServeSearchMissingTermErr) Code

func (e *ServeSearchMissingTermErr) Code() string

func (*ServeSearchMissingTermErr) Error

func (e *ServeSearchMissingTermErr) Error() string

func (*ServeSearchMissingTermErr) File

func (e *ServeSearchMissingTermErr) File() string

func (*ServeSearchMissingTermErr) Format

func (e *ServeSearchMissingTermErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*ServeSearchMissingTermErr) GetSeverity

func (e *ServeSearchMissingTermErr) GetSeverity() string

GetSeverity returns the "severity" label for a ServeSearchMissingTermErr instance.

func (*ServeSearchMissingTermErr) Guide

func (e *ServeSearchMissingTermErr) Guide() string

func (*ServeSearchMissingTermErr) HelpURL

func (e *ServeSearchMissingTermErr) HelpURL() string

func (*ServeSearchMissingTermErr) Labels

func (e *ServeSearchMissingTermErr) Labels() map[string]string

func (*ServeSearchMissingTermErr) Line

func (e *ServeSearchMissingTermErr) Line() int

func (*ServeSearchMissingTermErr) Message

func (e *ServeSearchMissingTermErr) Message() string

func (*ServeSearchMissingTermErr) UUID

func (e *ServeSearchMissingTermErr) UUID() string

func (*ServeSearchMissingTermErr) Unwrap

func (e *ServeSearchMissingTermErr) Unwrap() error

type ServeUnknownCodeErr

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

func NewServeUnknownCodeErr

func NewServeUnknownCodeErr(wrapped error, code string) *ServeUnknownCodeErr

func (*ServeUnknownCodeErr) Args

func (e *ServeUnknownCodeErr) Args() map[string]interface{}

func (*ServeUnknownCodeErr) Categories

func (e *ServeUnknownCodeErr) Categories() []string

func (*ServeUnknownCodeErr) Code

func (e *ServeUnknownCodeErr) Code() string

func (*ServeUnknownCodeErr) Error

func (e *ServeUnknownCodeErr) Error() string

func (*ServeUnknownCodeErr) File

func (e *ServeUnknownCodeErr) File() string

func (*ServeUnknownCodeErr) Format

func (e *ServeUnknownCodeErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*ServeUnknownCodeErr) GetCode

func (e *ServeUnknownCodeErr) GetCode() interface{}

GetCode returns the "code" argument for a ServeUnknownCodeErr instance.

func (*ServeUnknownCodeErr) GetHttpStatusCode

func (e *ServeUnknownCodeErr) GetHttpStatusCode() string

GetHttpStatusCode returns the "http_status_code" label for a ServeUnknownCodeErr instance.

func (*ServeUnknownCodeErr) GetSeverity

func (e *ServeUnknownCodeErr) GetSeverity() string

GetSeverity returns the "severity" label for a ServeUnknownCodeErr instance.

func (*ServeUnknownCodeErr) Guide

func (e *ServeUnknownCodeErr) Guide() string

func (*ServeUnknownCodeErr) HelpURL

func (e *ServeUnknownCodeErr) HelpURL() string

func (*ServeUnknownCodeErr) Labels

func (e *ServeUnknownCodeErr) Labels() map[string]string

func (*ServeUnknownCodeErr) Line

func (e *ServeUnknownCodeErr) Line() int

func (*ServeUnknownCodeErr) Message

func (e *ServeUnknownCodeErr) Message() string

func (*ServeUnknownCodeErr) UUID

func (e *ServeUnknownCodeErr) UUID() string

func (*ServeUnknownCodeErr) Unwrap

func (e *ServeUnknownCodeErr) Unwrap() error

type ServeUnknownRouteErr

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

func NewServeUnknownRouteErr

func NewServeUnknownRouteErr(wrapped error, route string) *ServeUnknownRouteErr

func (*ServeUnknownRouteErr) Args

func (e *ServeUnknownRouteErr) Args() map[string]interface{}

func (*ServeUnknownRouteErr) Categories

func (e *ServeUnknownRouteErr) Categories() []string

func (*ServeUnknownRouteErr) Code

func (e *ServeUnknownRouteErr) Code() string

func (*ServeUnknownRouteErr) Error

func (e *ServeUnknownRouteErr) Error() string

func (*ServeUnknownRouteErr) File

func (e *ServeUnknownRouteErr) File() string

func (*ServeUnknownRouteErr) Format

func (e *ServeUnknownRouteErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*ServeUnknownRouteErr) GetRoute

func (e *ServeUnknownRouteErr) GetRoute() interface{}

GetRoute returns the "route" argument for a ServeUnknownRouteErr instance.

func (*ServeUnknownRouteErr) GetSeverity

func (e *ServeUnknownRouteErr) GetSeverity() string

GetSeverity returns the "severity" label for a ServeUnknownRouteErr instance.

func (*ServeUnknownRouteErr) Guide

func (e *ServeUnknownRouteErr) Guide() string

func (*ServeUnknownRouteErr) HelpURL

func (e *ServeUnknownRouteErr) HelpURL() string

func (*ServeUnknownRouteErr) Labels

func (e *ServeUnknownRouteErr) Labels() map[string]string

func (*ServeUnknownRouteErr) Line

func (e *ServeUnknownRouteErr) Line() int

func (*ServeUnknownRouteErr) Message

func (e *ServeUnknownRouteErr) Message() string

func (*ServeUnknownRouteErr) UUID

func (e *ServeUnknownRouteErr) UUID() string

func (*ServeUnknownRouteErr) Unwrap

func (e *ServeUnknownRouteErr) Unwrap() error

type ServeWebUiErr

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

func NewServeWebUiErr

func NewServeWebUiErr(wrapped error, path string) *ServeWebUiErr

func (*ServeWebUiErr) Args

func (e *ServeWebUiErr) Args() map[string]interface{}

func (*ServeWebUiErr) Categories

func (e *ServeWebUiErr) Categories() []string

func (*ServeWebUiErr) Code

func (e *ServeWebUiErr) Code() string

func (*ServeWebUiErr) Error

func (e *ServeWebUiErr) Error() string

func (*ServeWebUiErr) File

func (e *ServeWebUiErr) File() string

func (*ServeWebUiErr) Format

func (e *ServeWebUiErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*ServeWebUiErr) GetPath

func (e *ServeWebUiErr) GetPath() interface{}

GetPath returns the "path" argument for a ServeWebUiErr instance.

func (*ServeWebUiErr) GetSeverity

func (e *ServeWebUiErr) GetSeverity() string

GetSeverity returns the "severity" label for a ServeWebUiErr instance.

func (*ServeWebUiErr) Guide

func (e *ServeWebUiErr) Guide() string

func (*ServeWebUiErr) HelpURL

func (e *ServeWebUiErr) HelpURL() string

func (*ServeWebUiErr) Labels

func (e *ServeWebUiErr) Labels() map[string]string

func (*ServeWebUiErr) Line

func (e *ServeWebUiErr) Line() int

func (*ServeWebUiErr) Message

func (e *ServeWebUiErr) Message() string

func (*ServeWebUiErr) UUID

func (e *ServeWebUiErr) UUID() string

func (*ServeWebUiErr) Unwrap

func (e *ServeWebUiErr) Unwrap() error

type Server

type Server struct {
	File string
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg WebUIConfig) (*Server, error)

func (*Server) Item

func (s *Server) Item(w http.ResponseWriter, req *http.Request)

func (*Server) List

func (s *Server) List(w http.ResponseWriter, _ *http.Request)

func (*Server) MethodNotAllowed

func (s *Server) MethodNotAllowed(w http.ResponseWriter, r *http.Request)

func (*Server) NotFound

func (s *Server) NotFound(w http.ResponseWriter, r *http.Request)

func (*Server) Search

func (s *Server) Search(w http.ResponseWriter, req *http.Request)

type TemplateExecutionErr

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

func NewTemplateExecutionErr

func NewTemplateExecutionErr(wrapped error) *TemplateExecutionErr

func (*TemplateExecutionErr) Args

func (e *TemplateExecutionErr) Args() map[string]interface{}

func (*TemplateExecutionErr) Categories

func (e *TemplateExecutionErr) Categories() []string

func (*TemplateExecutionErr) Code

func (e *TemplateExecutionErr) Code() string

func (*TemplateExecutionErr) Error

func (e *TemplateExecutionErr) Error() string

func (*TemplateExecutionErr) File

func (e *TemplateExecutionErr) File() string

func (*TemplateExecutionErr) Format

func (e *TemplateExecutionErr) Format(f fmt.State, verb rune)

Format controls the verbosity of the printed error.

func (*TemplateExecutionErr) GetSeverity

func (e *TemplateExecutionErr) GetSeverity() string

GetSeverity returns the "severity" label for a TemplateExecutionErr instance.

func (*TemplateExecutionErr) Guide

func (e *TemplateExecutionErr) Guide() string

func (*TemplateExecutionErr) HelpURL

func (e *TemplateExecutionErr) HelpURL() string

func (*TemplateExecutionErr) Labels

func (e *TemplateExecutionErr) Labels() map[string]string

func (*TemplateExecutionErr) Line

func (e *TemplateExecutionErr) Line() int

func (*TemplateExecutionErr) Message

func (e *TemplateExecutionErr) Message() string

func (*TemplateExecutionErr) UUID

func (e *TemplateExecutionErr) UUID() string

func (*TemplateExecutionErr) Unwrap

func (e *TemplateExecutionErr) Unwrap() error

type WebUIConfig

type WebUIConfig struct {
	Source   string
	BindAddr string
}

Directories

Path Synopsis
cmd
sample module

Jump to

Keyboard shortcuts

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