model

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MPL-2.0 Imports: 7 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsObjectIDHex

func IsObjectIDHex(s string) bool

Types

type DBM

type DBM map[string]interface{}

type DBObject

type DBObject interface {
	GetObjectID() ObjectID
	SetObjectID(id ObjectID)
	TableName() string
}

type Index

type Index struct {
	Name       string
	Background bool
	Keys       []DBM
	IsTTLIndex bool
	TTL        int
}

type ObjectID

type ObjectID string

func NewObjectID

func NewObjectID() ObjectID

func NewObjectIDWithTime

func NewObjectIDWithTime(t time.Time) ObjectID

func ObjectIDHex

func ObjectIDHex(id string) ObjectID

ObjectIDHex useful to create an object ID from the string

func (ObjectID) GetBSON

func (id ObjectID) GetBSON() (interface{}, error)

GetBSON only used by mgo

func (ObjectID) Hex

func (id ObjectID) Hex() string

func (ObjectID) MarshalJSON

func (id ObjectID) MarshalJSON() ([]byte, error)

func (*ObjectID) Scan

func (id *ObjectID) Scan(value interface{}) error

func (ObjectID) String

func (id ObjectID) String() string

func (ObjectID) Time added in v1.0.2

func (id ObjectID) Time() time.Time

func (ObjectID) Timestamp

func (id ObjectID) Timestamp() time.Time

func (*ObjectID) UnmarshalJSON

func (id *ObjectID) UnmarshalJSON(buf []byte) error

func (ObjectID) Valid

func (id ObjectID) Valid() bool

Valid returns true if id is valid. A valid id must contain exactly 12 bytes.

func (ObjectID) Value

func (id ObjectID) Value() (driver.Value, error)

Value is being used by SQL drivers

Jump to

Keyboard shortcuts

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