view

package
v0.0.0-...-ae6897b Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ISO8601TIME  = "2006-01-02T15:04:05-0700"
	ISO8601MICRO = "2006-01-02T15:04:05.999999-0700"

	DefaultLimit    = 20
	DefaultMaxLimit = 100
)

Variables

View Source
var (
	ErrorGEOSyntax      = fmt.Errorf("geolocation: Syntax Error")
	ErrorGEOBadLocation = fmt.Errorf("geolocation: Bad Location")
)
View Source
var DefaultEnvPool = &EnvPool{
	p: &sync.Pool{
		New: func() interface{} {
			return &Envelope{}
		},
	},
}

Functions

func ParseIso8601

func ParseIso8601(tm string) (time.Time, error)

func ParseIso8601Micro

func ParseIso8601Micro(tm string) (time.Time, error)

Types

type EnvPool

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

func (*EnvPool) Get

func (p *EnvPool) Get() *Envelope

type Envelope

type Envelope struct {
	Meta  api.Meta    `json:"meta"`
	Data  interface{} `json:"data,omitempty"`
	Extra interface{} `json:"extra,omitempty"`
	// contains filtered or unexported fields
}

func (*Envelope) Free

func (el *Envelope) Free()

func (*Envelope) Reset

func (el *Envelope) Reset()

func (*Envelope) String

func (el *Envelope) String() (string, error)

type GeoLocation

type GeoLocation struct {
	Latitude  float64
	Longitude float64
	// contains filtered or unexported fields
}

func (*GeoLocation) Parse

func (g *GeoLocation) Parse(geo string) error

Parse 解析geo:Latitude,Longtidude

type Pagination

type Pagination struct {
	Offset int
	Limit  int
	Since  string
	Until  string
}

func ParsePagination

func ParsePagination(c *gin.Context) (Pagination, error)

type Parameters

type Parameters struct {
	Search string
	Source string
	Filter string
	Query  string
	With   []string
}

func ParseParameters

func ParseParameters(c *gin.Context) (Parameters, error)

Jump to

Keyboard shortcuts

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