repo

package
v0.0.0-...-00f25a4 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthInfo

type AuthInfo struct {
	Sub   string
	Iss   string
	Token string
}

type Container

type Container struct {
	User         User
	Organization Organization
	Plugin       Plugin
	Transaction  usecasex.Transaction
}

type Organization

type Organization interface {
	Save(ctx context.Context, organization *user.Organization) error
}

type Plugin

type Plugin interface {
	Create(ctx context.Context, p *plugin.VersionedPlugin) error
	FindByID(ctx context.Context, id plugin.ID, user *id.UserID) (*plugin.Plugin, error)
	FindByIDs(ctx context.Context, ids []plugin.ID, user *id.UserID) ([]*plugin.Plugin, error)
	FindByVersion(ctx context.Context, id plugin.ID, version string) (*plugin.VersionedPlugin, error)
	SaveVersion(ctx context.Context, v *plugin.Version) error
	Save(ctx context.Context, p *plugin.Plugin) error
	Search(ctx context.Context, user *id.UserID, filter *interfaces.SearchPluginParam) ([]*plugin.VersionedPlugin, *usecasex.PageInfo, error)
	Like(ctx context.Context, user id.UserID, id plugin.ID) error
	Unlike(ctx context.Context, user id.UserID, id plugin.ID) error
	Versions(ctx context.Context, id plugin.ID) ([]*plugin.Version, error)
	UpdateLatest(ctx context.Context, p *plugin.Plugin) (*plugin.Plugin, error)
	List(ctx context.Context, uid id.UserID, filter *interfaces.ListPluginParam) ([]*plugin.VersionedPlugin, *usecasex.PageInfo, error)
	Liked(ctx context.Context, user id.UserID, id plugin.ID) (bool, error)
}

type Transaction

type Transaction interface {
	Begin() (Tx, error)
}

type Tx

type Tx interface {
	Commit()
	End(ctx context.Context) error
	IsCommitted() bool
}

type User

type User interface {
	FindOrCreate(ctx context.Context, authInfo AuthInfo) (*user.User, error)
	FindByIDs(ctx context.Context, ids id.UserIDList) ([]*user.User, error)
	SaveAll(ctx context.Context, users []*user.User) error
	Save(ctx context.Context, user *user.User) error
}

Jump to

Keyboard shortcuts

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