users

package
v0.0.0-...-20cb452 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Schema = `` /* 467-byte string literal not displayed */

Functions

This section is empty.

Types

type BeforeDump

type BeforeDump func(m *User)

BeforeDump allows you to edit result before dump.

type CacheQuerierConn

type CacheQuerierConn interface {
	GetCache() *dcache.DCache
	GetConn() wpgx.WQuerier
}

type CacheWGConn

type CacheWGConn interface {
	GetCache() *dcache.DCache
	GetConn() wpgx.WGConn
}

type CreateUserParams

type CreateUserParams struct {
	Name     string
	Metadata []byte
	Image    string
}

type ListUserNamesParams

type ListUserNamesParams struct {
	After int32
	First int32
}

type ListUserNamesRow

type ListUserNamesRow struct {
	ID   int32
	Name string
}

type ListUsersParams

type ListUsersParams struct {
	After int32
	First int32
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db wpgx.WGConn, cache *dcache.DCache) *Queries

func (*Queries) AsReadOnly

func (q *Queries) AsReadOnly() *ReadOnlyQueries

func (*Queries) Complicated

func (q *Queries) Complicated(ctx context.Context, n int32) (*int32, error)

-- cache : 1m example of sqlc cannot handle recursive query. -- timeout : 1s

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams, getUserByID *int32, getUserByName *string) (*User, error)

-- invalidate : [GetUserByID, GetUserByName] -- timeout : 1s

func (*Queries) DeleteBadUsers

func (q *Queries) DeleteBadUsers(ctx context.Context, name string, getUserByID *int32) (pgconn.CommandTag, error)

-- invalidate : [GetUserByID] -- timeout : 1s

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id int32, getUserByID *int32, getUserByName *string) error

-- invalidate : [GetUserByID, GetUserByName] -- timeout : 1s

func (*Queries) Dump

func (q *Queries) Dump(ctx context.Context, beforeDump ...BeforeDump) ([]byte, error)

func (*Queries) GetCache

func (q *Queries) GetCache() *dcache.DCache

func (*Queries) GetConn

func (q *Queries) GetConn() wpgx.WGConn

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id int32) (*User, error)

-- cache : 30s -- timeout : 1s

func (*Queries) GetUserByName

func (q *Queries) GetUserByName(ctx context.Context, name string) (*User, error)

-- timeout : 1s -- cache : 5m

func (*Queries) IncorrectQuery

func (q *Queries) IncorrectQuery(ctx context.Context, namePointer *string) (*User, error)

-- cache : 5m -- timeout : 1s

func (*Queries) ListUserNames

func (q *Queries) ListUserNames(ctx context.Context, arg ListUserNamesParams) ([]ListUserNamesRow, error)

-- timeout : 1s

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)

-- timeout : 1s

func (*Queries) Load

func (q *Queries) Load(ctx context.Context, data []byte) error

func (*Queries) UpdateMetaByID

func (q *Queries) UpdateMetaByID(ctx context.Context, arg UpdateMetaByIDParams) (int64, error)

-- timeout : 1s

func (*Queries) UpdateNameByID

func (q *Queries) UpdateNameByID(ctx context.Context, arg UpdateNameByIDParams) (*int32, error)

-- timeout : 1s

func (*Queries) UpdateUserGrade

func (q *Queries) UpdateUserGrade(ctx context.Context, arg UpdateUserGradeParams, getUserByID *int32) (int64, error)

-- invalidate : [GetUserByID] -- timeout : 1s

func (*Queries) UpsertUsers

func (q *Queries) UpsertUsers(ctx context.Context, arg UpsertUsersParams) error

-- timeout : 1s

func (*Queries) UseReplica

func (q *Queries) UseReplica(replicaQuerier wpgx.WQuerier) *ReadOnlyQueries

func (*Queries) WithCache

func (q *Queries) WithCache(cache *dcache.DCache) *Queries

func (*Queries) WithTx

func (q *Queries) WithTx(tx *wpgx.WTx) *Queries

type ReadOnlyQueries

type ReadOnlyQueries struct {
	// contains filtered or unexported fields
}

func (*ReadOnlyQueries) Complicated

func (q *ReadOnlyQueries) Complicated(ctx context.Context, n int32) (*int32, error)

func (*ReadOnlyQueries) GetCache

func (q *ReadOnlyQueries) GetCache() *dcache.DCache

func (*ReadOnlyQueries) GetConn

func (q *ReadOnlyQueries) GetConn() wpgx.WQuerier

func (*ReadOnlyQueries) GetUserByID

func (q *ReadOnlyQueries) GetUserByID(ctx context.Context, id int32) (*User, error)

func (*ReadOnlyQueries) GetUserByName

func (q *ReadOnlyQueries) GetUserByName(ctx context.Context, name string) (*User, error)

func (*ReadOnlyQueries) IncorrectQuery

func (q *ReadOnlyQueries) IncorrectQuery(ctx context.Context, namePointer *string) (*User, error)

func (*ReadOnlyQueries) ListUserNames

func (q *ReadOnlyQueries) ListUserNames(ctx context.Context, arg ListUserNamesParams) ([]ListUserNamesRow, error)

func (*ReadOnlyQueries) ListUsers

func (q *ReadOnlyQueries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)

func (*ReadOnlyQueries) WithCache

func (q *ReadOnlyQueries) WithCache(cache *dcache.DCache) *ReadOnlyQueries

type UpdateMetaByIDParams

type UpdateMetaByIDParams struct {
	Metadata []byte
	ID       int32
}

type UpdateNameByIDParams

type UpdateNameByIDParams struct {
	Name string
	ID   int32
}

type UpdateUserGradeParams

type UpdateUserGradeParams struct {
	Grade string
	Name  string
}

type UpsertUsersParams

type UpsertUsersParams struct {
	Name     []string
	Metadata [][]byte
	Image    []string
}

type User

type User struct {
	ID        int32     `json:"id"`
	Name      string    `json:"name"`
	Metadata  []byte    `json:"metadata"`
	Image     string    `json:"image"`
	CreatedAt time.Time `json:"created_at"`
}

Jump to

Keyboard shortcuts

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