repository

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: 14 Imported by: 0

Documentation

Overview

Code generated by yo. DO NOT EDIT.

Code generated by yo. DO NOT EDIT.

Code generated by yo. DO NOT EDIT.

Code generated by yo. DO NOT EDIT.

Code generated by yo. DO NOT EDIT.

Code generated by yo. DO NOT EDIT.

Code generated by yo. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("NotFound")
)

Functions

func DecodeInto

func DecodeInto(cols []string, row *spanner.Row, into Decodable) error

DecodeInto decodes row into Decodable The decoder is not goroutine-safe. Don't use it concurrently.

Types

type AllRepository added in v0.0.2

type AllRepository struct {
	Group     GroupRepository
	UserGroup UserGroupRepository
	User      UserRepository
}

func NewAllRepository added in v0.0.2

func NewAllRepository(client *spanner.Client) *AllRepository

type Decodable

type Decodable interface {
	ColumnsToPtrs([]string) ([]interface{}, error)
}

type GroupRepository

type GroupRepository interface {
	GroupRepositoryIndexes
	GroupRepositoryCRUD
}

func NewGroupRepository

func NewGroupRepository(client *spanner.Client) GroupRepository

type GroupRepositoryCRUD

type GroupRepositoryCRUD interface {
	FindAll(ctx context.Context) ([]*model.Group, error)
	FindAllWithCursor(ctx context.Context, limit int, cursor string) ([]*model.Group, error)
	CreateGroup(ctx context.Context, name string) (*model.Group, error)
	CreateOrUpdateGroup(ctx context.Context, groupID string, name string) (*model.Group, error)
	InsertGroup(ctx context.Context, group *model.Group) (*model.Group, error)
	InsertOrUpdateGroup(ctx context.Context, group *model.Group) (*model.Group, error)
	UpdateGroup(ctx context.Context, group *model.Group) error
	DeleteGroup(ctx context.Context, group *model.Group) error
}

type GroupRepositoryGenerated added in v0.0.2

type GroupRepositoryGenerated interface {
	GroupRepositoryIndexes
	GroupRepositoryCRUD
	GroupRepositoryUtil
}

type GroupRepositoryIndexes

type GroupRepositoryIndexes interface {
	GetGroupByGroupID(ctx context.Context, groupID string) (*model.Group, error)
	FindGroupsByGroupIDs(ctx context.Context, groupIDs []string) ([]*model.Group, error)
}

type GroupRepositoryUtil added in v0.0.2

type GroupRepositoryUtil interface {
	GroupIDs(in []*model.Group) []string
	GroupIDToGroupMap(in []*model.Group) map[string]*model.Group
}

type Key

type Key = spanner.Key

type KeyRange

type KeyRange = spanner.KeyRange

type Params

type Params = map[string]interface{}

type Repository

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

func (Repository) Transaction

func (r Repository) Transaction(ctx context.Context, fn func(tx Transaction) error) error

type Row

type Row = *spanner.Row

type Transaction

type Transaction = *spanner.ReadWriteTransaction

type UserGroupRepository

type UserGroupRepository interface {
	UserGroupRepositoryIndexes
	UserGroupRepositoryCRUD
}

func NewUserGroupRepository

func NewUserGroupRepository(client *spanner.Client) UserGroupRepository

type UserGroupRepositoryCRUD

type UserGroupRepositoryCRUD interface {
	FindAll(ctx context.Context) ([]*model.UserGroup, error)
	CreateUserGroup(ctx context.Context, groupID string, userID string) (*model.UserGroup, error)
	CreateOrUpdateUserGroup(ctx context.Context, groupID string, userID string) (*model.UserGroup, error)
	InsertUserGroup(ctx context.Context, userGroup *model.UserGroup) (*model.UserGroup, error)
	InsertOrUpdateUserGroup(ctx context.Context, userGroup *model.UserGroup) (*model.UserGroup, error)
	UpdateUserGroup(ctx context.Context, userGroup *model.UserGroup) error
	DeleteUserGroup(ctx context.Context, userGroup *model.UserGroup) error
}

type UserGroupRepositoryGenerated added in v0.0.2

type UserGroupRepositoryGenerated interface {
	UserGroupRepositoryIndexes
	UserGroupRepositoryCRUD
	UserGroupRepositoryUtil
}

type UserGroupRepositoryIndexes

type UserGroupRepositoryIndexes interface {
	GetUserGroupByGroupIDAndUserID(ctx context.Context, groupID string, userID string) (*model.UserGroup, error)
	FindUserGroupsByGroupIDsAndUserIDs(ctx context.Context, groupIDs []string, userIDs []string) ([]*model.UserGroup, error)
	FindUserGroupsByGroupIDs(ctx context.Context, groupIDs []string) ([]*model.UserGroup, error)
	FindUserGroupsByUserIDs(ctx context.Context, userIDs []string) ([]*model.UserGroup, error)
	GetUserGroupByGroupID(ctx context.Context, groupID string) (*model.UserGroup, error)
	GetUserGroupByGroupIDFast(ctx context.Context, groupID string) (*model.UserGroup, error)
	FindUserGroupsByUserID(ctx context.Context, userID string) ([]*model.UserGroup, error)
	FindUserGroupsByUserIDFast(ctx context.Context, userID string) ([]*model.UserGroup, error)
}

type UserGroupRepositoryUtil added in v0.0.2

type UserGroupRepositoryUtil interface {
	GroupIDs(in []*model.UserGroup) []string
	GroupIDToUserGroupsMap(in []*model.UserGroup) map[string][]*model.UserGroup
	UserIDs(in []*model.UserGroup) []string
	UserIDToUserGroupsMap(in []*model.UserGroup) map[string][]*model.UserGroup
}

type UserRepository

type UserRepository interface {
	UserRepositoryIndexes
	UserRepositoryCRUD
}

func NewUserRepository

func NewUserRepository(client *spanner.Client) UserRepository

type UserRepositoryCRUD

type UserRepositoryCRUD interface {
	FindAll(ctx context.Context) ([]*model.User, error)
	FindAllWithCursor(ctx context.Context, limit int, cursor string) ([]*model.User, error)
	CreateUser(ctx context.Context, name string, status int64) (*model.User, error)
	CreateOrUpdateUser(ctx context.Context, userID string, name string, status int64) (*model.User, error)
	InsertUser(ctx context.Context, user *model.User) (*model.User, error)
	InsertOrUpdateUser(ctx context.Context, user *model.User) (*model.User, error)
	UpdateUser(ctx context.Context, user *model.User) error
	DeleteUser(ctx context.Context, user *model.User) error
}

type UserRepositoryGenerated added in v0.0.2

type UserRepositoryGenerated interface {
	UserRepositoryIndexes
	UserRepositoryCRUD
	UserRepositoryUtil

} //

type UserRepositoryIndexes

type UserRepositoryIndexes interface {
	GetUserByUserID(ctx context.Context, userID string) (*model.User, error)
	FindUsersByUserIDs(ctx context.Context, userIDs []string) ([]*model.User, error)
	FindUsersByName(ctx context.Context, name string) ([]*model.User, error)
	FindUsersByNameFast(ctx context.Context, name string) ([]*model.User, error)
	FindUsersByNames(ctx context.Context, names []string) ([]*model.User, error)
	FindUsersByNameAndStatus(ctx context.Context, name string, status int64) ([]*model.User, error)
	FindUsersByNameAndStatusFast(ctx context.Context, name string, status int64) ([]*model.User, error)
	FindUsersByNamesAndStatuses(ctx context.Context, names []string, statuses []int64) ([]*model.User, error)
}

type UserRepositoryUtil added in v0.0.2

type UserRepositoryUtil interface {
	UserIDs(in []*model.User) []string
	UserIDToUserMap(in []*model.User) map[string]*model.User
	Names(in []*model.User) []string
	NameToUsersMap(in []*model.User) map[string][]*model.User
	Statuses(in []*model.User) []int64
	StatusToUsersMap(in []*model.User) map[int64][]*model.User
}

Jump to

Keyboard shortcuts

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