model

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Code generated by yo. DO NOT EDIT. Package model contains the types.

Code generated by yo. DO NOT EDIT. Package model contains the types.

Code generated by yo. DO NOT EDIT. Package model contains the types.

Code generated by yo. DO NOT EDIT. Package model contains the types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupColumns

func GroupColumns() []string

func GroupColumnsByIndexName

func GroupColumnsByIndexName(index string) []string

func GroupPrimaryKeys

func GroupPrimaryKeys() []string

func NewUUID added in v0.0.2

func NewUUID() (string, error)

func UserColumns

func UserColumns() []string

func UserColumnsByIndexName

func UserColumnsByIndexName(index string) []string

func UserGroupColumns

func UserGroupColumns() []string

func UserGroupColumnsByIndexName

func UserGroupColumnsByIndexName(index string) []string

func UserGroupPrimaryKeys

func UserGroupPrimaryKeys() []string

func UserPrimaryKeys

func UserPrimaryKeys() []string

Types

type Group

type Group struct {
	GroupID   string    `spanner:"group_id" json:"groupID"`
	Name      string    `spanner:"name" json:"name"`
	CreatedAt time.Time `spanner:"created_at" json:"createdAt"`
	UpdatedAt time.Time `spanner:"updated_at" json:"updatedAt"`
}

Group represents a row from 'groups'.

func (*Group) ColumnsToPtrs

func (g *Group) ColumnsToPtrs(cols []string) ([]interface{}, error)

func (*Group) Delete

func (g *Group) Delete() *spanner.Mutation

Delete deletes the Group from the database.

func (*Group) Insert

func (g *Group) Insert() *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*Group) InsertOrUpdate

func (g *Group) InsertOrUpdate() *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*Group) Ptrs added in v0.0.2

func (g *Group) Ptrs() []interface{}

func (*Group) SetIdentity

func (g *Group) SetIdentity() (err error)

func (*Group) Update

func (g *Group) Update() *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*Group) UpdateColumns

func (g *Group) UpdateColumns(cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

func (*Group) UpdateMap

func (g *Group) UpdateMap(groupMap map[string]interface{}) *spanner.Mutation

UpdateMap returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

type H

type H = map[string]interface{}

type User

type User struct {
	UserID    string    `spanner:"user_id" json:"userID"`
	Name      string    `spanner:"name" json:"name"`
	Status    int64     `spanner:"status" json:"status"`
	CreatedAt time.Time `spanner:"created_at" json:"createdAt"`
	UpdatedAt time.Time `spanner:"updated_at" json:"updatedAt"`
}

User represents a row from 'users'.

func (*User) ColumnsToPtrs

func (u *User) ColumnsToPtrs(cols []string) ([]interface{}, error)

func (*User) Delete

func (u *User) Delete() *spanner.Mutation

Delete deletes the User from the database.

func (*User) Insert

func (u *User) Insert() *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*User) InsertOrUpdate

func (u *User) InsertOrUpdate() *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*User) Ptrs added in v0.0.2

func (u *User) Ptrs() []interface{}

func (*User) SetIdentity

func (u *User) SetIdentity() (err error)

func (*User) Update

func (u *User) Update() *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*User) UpdateColumns

func (u *User) UpdateColumns(cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

func (*User) UpdateMap

func (u *User) UpdateMap(userMap map[string]interface{}) *spanner.Mutation

UpdateMap returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

type UserGroup

type UserGroup struct {
	GroupID   string    `spanner:"group_id" json:"groupID"`
	UserID    string    `spanner:"user_id" json:"userID"`
	CreatedAt time.Time `spanner:"created_at" json:"createdAt"`
	UpdatedAt time.Time `spanner:"updated_at" json:"updatedAt"`
}

UserGroup represents a row from 'user_groups'.

func (*UserGroup) ColumnsToPtrs

func (ug *UserGroup) ColumnsToPtrs(cols []string) ([]interface{}, error)

func (*UserGroup) Delete

func (ug *UserGroup) Delete() *spanner.Mutation

Delete deletes the UserGroup from the database.

func (*UserGroup) Insert

func (ug *UserGroup) Insert() *spanner.Mutation

Insert returns a Mutation to insert a row into a table. If the row already exists, the write or transaction fails.

func (*UserGroup) InsertOrUpdate

func (ug *UserGroup) InsertOrUpdate() *spanner.Mutation

InsertOrUpdate returns a Mutation to insert a row into a table. If the row already exists, it updates it instead. Any column values not explicitly written are preserved.

func (*UserGroup) Ptrs added in v0.0.2

func (ug *UserGroup) Ptrs() []interface{}

func (*UserGroup) SetIdentity

func (ug *UserGroup) SetIdentity() (err error)

func (*UserGroup) Update

func (ug *UserGroup) Update() *spanner.Mutation

Update returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

func (*UserGroup) UpdateColumns

func (ug *UserGroup) UpdateColumns(cols ...string) (*spanner.Mutation, error)

UpdateColumns returns a Mutation to update specified columns of a row in a table.

func (*UserGroup) UpdateMap

func (ug *UserGroup) UpdateMap(usergroupMap map[string]interface{}) *spanner.Mutation

UpdateMap returns a Mutation to update a row in a table. If the row does not already exist, the write or transaction fails.

Jump to

Keyboard shortcuts

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