usecase

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package usecase has interfaces that wrap the basic business logic.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoProfile is returned when the profile is not found.
	ErrNoProfile = errors.New("no profile")
)

Functions

This section is empty.

Types

type AuthorGetter

type AuthorGetter interface {
	GetAuthor(ctx context.Context, input *AuthorGetterInput) (*AuthorGetterOutput, error)
}

AuthorGetter is the interface that wraps the basic GetAuthor method.

type AuthorGetterInput

type AuthorGetterInput struct {
	NSecretKey model.NSecretKey // NSecretKey is the user's private key.
}

AuthorGetterInput is the input of the GetAuthor method.

type AuthorGetterOutput

type AuthorGetterOutput struct {
	// Author is the your(honeycomb user) profile data.
	Author *model.Author
}

AuthorGetterOutput is the output of the GetAuthor method.

type FollowLister

type FollowLister interface {
	ListFollow(ctx context.Context, input *FollowListerInput) (*FollowListerOutput, error)
}

FollowLister is the interface that wraps the basic FollowLister method.

type FollowListerInput

type FollowListerInput struct {
	PublicKey      model.PublicKey // PublicKey is the user's public key.
	ConnectedRelay *nostr.Relay    // ConnectedRelay is the connected relay
}

FollowListerInput is the input of the FollowersLister method.

type FollowListerOutput

type FollowListerOutput struct {
	Follows model.Follows // Follows is the list of follow user.
}

FollowListerOutput is the output of the FollowLister method.

type Liker added in v0.0.2

type Liker interface {
	Like(ctx context.Context, input *LikerInput) (*LikerOutput, error)
}

Liker is the interface that wraps the basic Like method.

type LikerInput added in v0.0.2

type LikerInput struct {
	PostID         string // PostID is the post id.
	PrivateKey     model.PrivateKey
	NPublicKey     model.NPublicKey
	ConnectedRelay *nostr.Relay // ConnectedRelay is the connected relay.
}

LikerInput is the input of the Like method.

type LikerOutput added in v0.0.2

type LikerOutput struct{}

LikerOutput is the output of the Like method.

type Poster

type Poster interface {
	Post(ctx context.Context, input *PosterInput) (*PosterOutput, error)
}

Poster is the interface that wraps the basic Poster method.

type PosterInput

type PosterInput struct {
	Content        string // Content is the post content.
	PrivateKey     model.PrivateKey
	NPublicKey     model.NPublicKey // NPublicKey is the user's public key.
	ConnectedRelay *nostr.Relay     // ConnectedRelay is the connected relay.
}

PosterInput is the input of the Post method.

type PosterOutput

type PosterOutput struct{}

PosterOutput is the output of the Post method.

type ProfileGetter

type ProfileGetter interface {
	GetProfile(ctx context.Context, input *ProfileGetterInput) (*ProfileGetterOutput, error)
}

ProfileGetter is the interface that wraps the basic GetProfile method.

type ProfileGetterInput

type ProfileGetterInput struct {
	PublicKey      model.PublicKey // PublicKey is the user's public key.
	ConnectedRelay *nostr.Relay    // ConnectedRelay is the connected relay
}

ProfileGetterInput is the input of the GetProfile method.

type ProfileGetterOutput

type ProfileGetterOutput struct {
	// Profile is the user's profile.
	Profile model.Profile
	// NPublicKey is the user's public key.
	NPublicKey model.NPublicKey
}

ProfileGetterOutput is the output of the GetProfile method.

type TimelineLister

type TimelineLister interface {
	ListTimeline(ctx context.Context, input *TimelineListerInput) (*TimelineListerOutput, error)
}

TimelineLister is the interface that wraps the basic ListTimeline method.

type TimelineListerInput

type TimelineListerInput struct {
	Follows        model.Follows    // Follows is the list of follow user.
	Since          *nostr.Timestamp // Since is the time to get posts from.
	Until          *nostr.Timestamp // Until is the time to get posts until.
	Limit          int              // Limit is the number of posts to get.
	ConnectedRelay *nostr.Relay     // ConnectedRelay is the connected relay
}

TimelineListerInput is the input of the ListTimeline method.

type TimelineListerOutput

type TimelineListerOutput struct {
	Posts []*model.Post // Posts is the list of posts. The list is sorted by the time of the post.
}

TimelineListerOutput is the output of the ListTimeline method.

Jump to

Keyboard shortcuts

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