helpers

package
v0.0.0-...-492db17 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ErrInvalidDuration = Error("invalid duration")

	ErrInvalidValueType = Error("invalid bson value type")
	ErrInvalidString    = Error("invalid bson string")
)

helpers errors

Variables

View Source
var DefaultContextExpireTime time.Duration = 2 * time.Second

DefaultContextExpireTime defines duration in which context expires, which is used in GetCtx() The default value is `10 * time.Second`

Functions

func GetCtx

func GetCtx() context.Context

Types

type Duration

type Duration time.Duration

Duration is needed because default time.Duration does not support marshalling.

func (Duration) MarshalBSONValue

func (d Duration) MarshalBSONValue() (bsontype.Type, []byte, error)

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON implements json marshaller interface

func (*Duration) UnmarshalBSONValue

func (d *Duration) UnmarshalBSONValue(t bsontype.Type, b []byte) error

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json unmarshaller interface

type Error

type Error string

Error is an error type for internal errors

func (Error) Error

func (e Error) Error() string

Error implements error interface

Jump to

Keyboard shortcuts

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