repo_impls

package
v0.0.0-...-02ad720 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFollowAlreadyExists = errors.New("follow already exists")
View Source
var (
	ErrUsernameTaken = errors.New("username taken")
)

Functions

func NewFollowRepositoryImpl

func NewFollowRepositoryImpl(db *ent.Client, log logr.Logger, telemetry *unitel.Telemetry) repository.FollowRepository

func NewInstanceMetadataRepositoryImpl

func NewInstanceMetadataRepositoryImpl(federationService service.FederationService, db *ent.Client, log logr.Logger, telemetry *unitel.Telemetry) repository.InstanceMetadataRepository

func NewNoteRepositoryImpl

func NewNoteRepositoryImpl(db *ent.Client, log logr.Logger, telemetry *unitel.Telemetry) repository.NoteRepository

func NewUserRepositoryImpl

func NewUserRepositoryImpl(federationService service.FederationService, db *ent.Client, log logr.Logger, telemetry *unitel.Telemetry) repository.UserRepository

Types

type Factory

type Factory[T any] func(db *ent.Client, log logr.Logger, telemetry *unitel.Telemetry) T

type FollowRepositoryImpl

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

func (FollowRepositoryImpl) AcceptFollow

func (i FollowRepositoryImpl) AcceptFollow(ctx context.Context, follower, followee *entity.User) error

func (FollowRepositoryImpl) Follow

func (i FollowRepositoryImpl) Follow(ctx context.Context, follower, followee *entity.User) (*entity.Follow, error)

func (FollowRepositoryImpl) GetByID

func (FollowRepositoryImpl) RejectFollow

func (i FollowRepositoryImpl) RejectFollow(ctx context.Context, follower, followee *entity.User) error

func (FollowRepositoryImpl) Unfollow

func (i FollowRepositoryImpl) Unfollow(ctx context.Context, follower, followee *entity.User) error

type InstanceMetadataRepositoryImpl

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

func (*InstanceMetadataRepositoryImpl) GetByHost

func (*InstanceMetadataRepositoryImpl) ImportFromVersiaByURI

type ManagerImpl

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

func NewManagerImpl

func NewManagerImpl(
	db *ent.Client, telemetry *unitel.Telemetry, log logr.Logger,
	userRepositoryFunc Factory[repository.UserRepository],
	noteRepositoryFunc Factory[repository.NoteRepository],
	followRepositoryFunc Factory[repository.FollowRepository],
	instanceMetadataRepositoryFunc Factory[repository.InstanceMetadataRepository],
) *ManagerImpl

func (*ManagerImpl) Atomic

func (i *ManagerImpl) Atomic(ctx context.Context, fn func(ctx context.Context, tx repository.Manager) error) error

func (*ManagerImpl) Follows

func (*ManagerImpl) InstanceMetadata

func (i *ManagerImpl) InstanceMetadata() repository.InstanceMetadataRepository

func (*ManagerImpl) Notes

func (*ManagerImpl) Users

type NoteRepositoryImpl

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

func (*NoteRepositoryImpl) GetByID

func (i *NoteRepositoryImpl) GetByID(ctx context.Context, id uuid.UUID) (*entity.Note, error)

func (*NoteRepositoryImpl) ImportVersiaNote

func (i *NoteRepositoryImpl) ImportVersiaNote(ctx context.Context, lNote *versia.Note) (*entity.Note, error)

func (*NoteRepositoryImpl) NewNote

func (i *NoteRepositoryImpl) NewNote(ctx context.Context, author *entity.User, content string, mentions []*entity.User) (*entity.Note, error)

type UserRepositoryImpl

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

func (*UserRepositoryImpl) Discover

func (i *UserRepositoryImpl) Discover(ctx context.Context, domain, username string) (*entity.User, error)

func (*UserRepositoryImpl) GetByID

func (i *UserRepositoryImpl) GetByID(ctx context.Context, uid uuid.UUID) (*entity.User, error)

func (*UserRepositoryImpl) GetLocalByID

func (i *UserRepositoryImpl) GetLocalByID(ctx context.Context, uid uuid.UUID) (*entity.User, error)

func (*UserRepositoryImpl) GetLocalByUsername

func (i *UserRepositoryImpl) GetLocalByUsername(ctx context.Context, username string) (*entity.User, error)

func (*UserRepositoryImpl) ImportVersiaUserByURI

func (i *UserRepositoryImpl) ImportVersiaUserByURI(ctx context.Context, uri *versiautils.URL) (*entity.User, error)

func (*UserRepositoryImpl) LookupByURI

func (i *UserRepositoryImpl) LookupByURI(ctx context.Context, uri *versiautils.URL) (*entity.User, error)

func (*UserRepositoryImpl) LookupByURIs

func (i *UserRepositoryImpl) LookupByURIs(ctx context.Context, uris []versiautils.URL) ([]*entity.User, error)

func (*UserRepositoryImpl) LookupLocalByIDOrUsername

func (i *UserRepositoryImpl) LookupLocalByIDOrUsername(ctx context.Context, idOrUsername string) (*entity.User, error)

func (*UserRepositoryImpl) NewUser

func (i *UserRepositoryImpl) NewUser(ctx context.Context, username, password string, priv ed25519.PrivateKey, pub ed25519.PublicKey) (*entity.User, error)

func (*UserRepositoryImpl) Resolve

func (i *UserRepositoryImpl) Resolve(ctx context.Context, uri *versiautils.URL) (*entity.User, error)

func (*UserRepositoryImpl) ResolveMultiple

func (i *UserRepositoryImpl) ResolveMultiple(ctx context.Context, uris []versiautils.URL) ([]*entity.User, error)

Jump to

Keyboard shortcuts

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