lxHelper

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlePanicErr added in v1.0.0

func HandlePanicErr(err error)

HandlePanicErr, handle error as panic

func ReadResponseBody added in v1.0.0

func ReadResponseBody(resp *http.Response, result interface{}) error

ReadResponseBody, read and convert body

func Request added in v1.0.0

func Request(header http.Header, body interface{}, uri, method string, timeout time.Duration) (*http.Response, error)

Request

Types

type FindOptions added in v1.0.0

type FindOptions struct {
	Sort  map[string]int `json:"sort,omitempty"`
	Skip  int64          `json:"skip"`
	Limit int64          `json:"limit"`
}

FindOptions

func (*FindOptions) ToMongoCountOptions added in v1.0.0

func (fo *FindOptions) ToMongoCountOptions() *options.CountOptions

ToMongoCountOptions

func (*FindOptions) ToMongoFindOneOptions added in v1.0.0

func (fo *FindOptions) ToMongoFindOneOptions() *options.FindOneOptions

ToMongoFindOneOptions

func (*FindOptions) ToMongoFindOptions added in v1.0.0

func (fo *FindOptions) ToMongoFindOptions() *options.FindOptions

ToMongoFindOptions

type M

type M map[string]interface{}

type RequestByQuery added in v0.8.0

type RequestByQuery struct {
	FindOptions FindOptions            `json:"opts,omitempty"`
	Query       map[string]interface{} `json:"query"`
	Count       bool                   `json:"count"`
}

RequestByQuery

func NewRequestByQuery added in v0.8.0

func NewRequestByQuery(queryStr string) (data *RequestByQuery, err error)

NewRequestByQuery, convert query string ?config={"opts":{"sort":{"name":1, "email": -1},"skip":5,"limit":10},"query":{"name":"Schulterglatze"}, "count":true}

Jump to

Keyboard shortcuts

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