lxHelper

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: MIT Imports: 7 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 A added in v1.7.0

type A []M

type FindOptions added in v1.0.0

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

FindOptions

func (*FindOptions) ToMongoCountOptions added in v1.0.0

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

ToMongoCountOptions

func (*FindOptions) ToMongoFindOneAndDeleteOptions added in v1.5.0

func (fo *FindOptions) ToMongoFindOneAndDeleteOptions() *options.FindOneAndDeleteOptions

ToMongoFindOneAndDeleteOptions

func (*FindOptions) ToMongoFindOneAndReplaceOptions added in v1.5.0

func (fo *FindOptions) ToMongoFindOneAndReplaceOptions() *options.FindOneAndReplaceOptions

ToMongoFindOneAndReplaceOptions

func (*FindOptions) ToMongoFindOneAndUpdateOptions added in v1.5.0

func (fo *FindOptions) ToMongoFindOneAndUpdateOptions() *options.FindOneAndUpdateOptions

ToMongoFindOneAndDeleteOptions

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{}

func ToMap added in v1.7.0

func ToMap(v interface{}) (ret M, err error)

ToMap, convert interface to lxHelper.M

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