db

package
v0.0.0-...-52ba2b6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Delete

func Delete(c context.Context, p Patchable) error

func Get

func Get(c context.Context, p Patchable) error

func Save

func Save(c context.Context, p Patchable) error

func SaveAndGet

func SaveAndGet(c context.Context, p Patchable) error

Types

type DatastoreModel

type DatastoreModel struct {
	Key       *datastore.Key `datastore:"__key__" json:"key"`
	Kind      string         `datastore:"-" json:"-"`
	CreatedAt time.Time      `datastore:"created_at" json:"createdAt"`
	UpdatedAt time.Time      `datastore:"updated_at" json:"updatedAt"`
}

func (*DatastoreModel) GetKey

func (dm *DatastoreModel) GetKey() *datastore.Key

func (*DatastoreModel) GetKind

func (dm *DatastoreModel) GetKind() string

func (*DatastoreModel) NewKey

func (dm *DatastoreModel) NewKey(idOrName interface{}, parent *datastore.Key) error

func (*DatastoreModel) SetCreatedAt

func (dm *DatastoreModel) SetCreatedAt()

func (*DatastoreModel) SetKey

func (dm *DatastoreModel) SetKey(key *datastore.Key)

func (*DatastoreModel) SetUpdatedAt

func (dm *DatastoreModel) SetUpdatedAt()

func (*DatastoreModel) Validate

func (dm *DatastoreModel) Validate() error

type Patchable

type Patchable interface {
	Patch(interface{})
	New(*datastore.Key) Patchable
	NewKey(interface{}, *datastore.Key) error
	SetKey(*datastore.Key)
	GetKey() *datastore.Key
	GetKind() string
	SetUpdatedAt()
	SetCreatedAt()
	Validate() error
	CreateTemplate() *template.Template
	UpdateTemplate() *template.Template
	GetMultiTemplate() *template.Template
	GetOneTemplate() *template.Template
}

Jump to

Keyboard shortcuts

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