repository

package
v0.0.0-...-706d53e Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActorRepository

func NewActorRepository(database database.Database) *actorRepo

func NewUserRepository

func NewUserRepository(database database.Database) *userRepo

Types

type ActorRepository

type ActorRepository interface {
	Get(ctx context.Context, url *url.URL) (*models.Actor, error)
	Create(context.Context, CreateActorRequest) (*models.Actor, error)
}

type CreateActorRequest

type CreateActorRequest struct {
	URL       *url.URL
	PublicKey crypto.PublicKey
}

type CreateUserRequest

type CreateUserRequest struct {
	Username   string
	ID         string
	CreatedAt  time.Time
	PrivateKey *rsa.PrivateKey
}

type UserRepository

type UserRepository interface {
	Get(context.Context, string) (*models.User, error)
	GetFollowers(context.Context, *models.User) (models.ActorSlice, error)
	Follow(context.Context, *models.User, *models.Actor) error
	UnFollow(context.Context, *models.User, *models.Actor) error
	CreateUser(context.Context, CreateUserRequest) (*models.User, error)
	GetWithFollowers(ctx context.Context) (models.UserSlice, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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