loader

package
v0.0.0-...-47e1cbe Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBLoader

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

A DBLoader can fetch a graph of objects from the database

func NewDBLoader

func NewDBLoader(db *sqlx.DB) *DBLoader

NewDBLoader makes a new DBLoader

func (*DBLoader) ExecuteBatches

func (l *DBLoader) ExecuteBatches()

func (*DBLoader) FetchLikesByPostID

func (l *DBLoader) FetchLikesByPostID(postID types.ID, fieldNames []string) <-chan LikesFetchResult

func (*DBLoader) FetchLikesByUserID

func (l *DBLoader) FetchLikesByUserID(userID types.ID, fieldNames []string) <-chan LikesFetchResult

func (*DBLoader) FetchPostByID

func (l *DBLoader) FetchPostByID(postID types.ID, fieldNames []string) <-chan PostFetchResult

func (*DBLoader) FetchPosts

func (l *DBLoader) FetchPosts(from types.ID, count types.Int, fieldNames []string) <-chan PostsFetchResult

func (*DBLoader) FetchPostsByUserID

func (l *DBLoader) FetchPostsByUserID(userID types.ID, fieldNames []string) <-chan PostsFetchResult

func (*DBLoader) FetchUserByID

func (l *DBLoader) FetchUserByID(userID types.ID, fieldNames []string) <-chan UserFetchResult

func (*DBLoader) FetchUsers

func (l *DBLoader) FetchUsers(from types.ID, count types.Int, fieldNames []string) <-chan UsersFetchResult

type LikeColumns

type LikeColumns struct {
	ID     types.ID
	UserID types.ID `db:"user_id"`
	PostID types.ID `db:"post_id"`
}

type LikesFetchResult

type LikesFetchResult struct {
	Error error
	Likes []*LikeColumns
}

type PostColumns

type PostColumns struct {
	ID       types.ID
	AuthorID types.ID `db:"author_id"`
	Title    types.String
	Body     types.String
}

type PostFetchResult

type PostFetchResult struct {
	Error error
	Post  *PostColumns
}

type PostsFetchResult

type PostsFetchResult struct {
	Error error
	Posts []*PostColumns
}

type UserColumns

type UserColumns struct {
	ID   types.ID
	Name types.String
}

type UserFetchResult

type UserFetchResult struct {
	Error error
	User  *UserColumns
}

type UsersFetchResult

type UsersFetchResult struct {
	Error error
	Users []*UserColumns
}

Jump to

Keyboard shortcuts

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