repository

package
v0.0.0-...-36feab7 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFollowerNotFound = errors.New("follower not found")
)

Common errors

View Source
var (
	ErrUserNotFound = errors.New("user not found")
)

Functions

This section is empty.

Types

type FollowerRepository

type FollowerRepository interface {
	Create(ctx context.Context, userID int, followerReferenceID string) error
	Delete(ctx context.Context, userID int, followerReferenceID string) error
}

FollowerRepository is used to manipulate and perform write operations on the user follower records.

func NewFollowerRepository

func NewFollowerRepository(db database.Database) FollowerRepository

NewFollowerRepository returns a new instance of FollowerRepository.

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, u *model.User) error
	DoesUsernameExist(ctx context.Context, username string, excludeRefID *string) (bool, error)
	GetUserByUsername(ctx context.Context, username string) (*model.User, error)

	// GetUserByReference gets a user's model by referenceID,
	// for the user with the reference userReferenceID.
	GetUserByReference(ctx context.Context, referenceID, userReferenceID string) (*model.User, error)
	GetIDByReference(ctx context.Context, referenceID string) (*int, error)
}

func NewUserRepository

func NewUserRepository(url string) UserRepository

Jump to

Keyboard shortcuts

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