types

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2022 License: MPL-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ContentType = "application/json"
)

Variables

View Source
var (

	// ErrBadIdentifier indicates a bad identifer pattern
	ErrBadIdentifier = errors.New("invalid identifier, must match " + idRegexp)
)

Functions

func EncodeResponse

func EncodeResponse(_ context.Context, w http.ResponseWriter, response interface{}) error

Types

type ErrorRes

type ErrorRes struct {
	Err string `json:"error"`
}

type Identifier

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

func NewIdentifier

func NewIdentifier(v string) (Identifier, error)

func (*Identifier) IsValid

func (i *Identifier) IsValid() bool

func (*Identifier) Scan

func (i *Identifier) Scan(value interface{}) error

Scan - Implement the database/sql scanner interface

func (*Identifier) String

func (i *Identifier) String() string

func (Identifier) Value

func (i Identifier) Value() (driver.Value, error)

Value Implements valuer

type Metadata

type Metadata map[string]interface{}

Metadata Maybe a full object hierarchy

func (*Metadata) FilterMap

func (s *Metadata) FilterMap(predicateFunc func(string) bool, mapFunc func(string, interface{}) (string, interface{}))

func (*Metadata) IsApplicable

func (s *Metadata) IsApplicable(filterFunc func(string, interface{}) bool) bool

func (*Metadata) RestrictKeys

func (s *Metadata) RestrictKeys(predicate func(string) bool)

func (*Metadata) Scan

func (s *Metadata) Scan(src interface{}) error

type Response

type Response interface {
	// Code returns HTTP response code.
	Code() int

	// Headers returns map of HTTP headers with their values.
	Headers() map[string]string

	// Empty indicates if HTTP response has content.
	Empty() bool
}

Response contains HTTP response specific methods.

type Tags

type Tags map[string]string

Tags A flat kv pair object

Jump to

Keyboard shortcuts

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