apps

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCredentials = errors.New("invalid credentials")
	ErrNotCreator         = errors.New("user isn't creator")
	ErrAppExists          = errors.New("app exists")
	ErrAppNotFound        = errors.New("app not found")
	ErrUserNotCreator     = errors.New("user not creator")
)

Functions

This section is empty.

Types

type AdminProvider

type AdminProvider interface {
	SetAdmin(ctx context.Context, email string, appName string) error
}

type Apps

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

func New

func New(log *slog.Logger, appsSetterDeleter AppsSetterDeleter, userProvider UserProvider, creatorProvider CreatorProvider, adminProvider AdminProvider) *Apps

New returns a new instanse of the Permissions service

func (*Apps) DelApp

func (a *Apps) DelApp(ctx context.Context, appName string) (bool, error)

func (*Apps) GetAppID

func (a *Apps) GetAppID(ctx context.Context, appName string) (int, string, error)

func (*Apps) SetApp

func (a *Apps) SetApp(ctx context.Context, email string, appName string, appSecret string) (int, error)

func (*Apps) UpdApp

func (a *Apps) UpdApp(ctx context.Context, appName string, NewAppName string, NewAppSecret string) (bool, error)

type AppsSetterDeleter

type AppsSetterDeleter interface {
	GetAppID(ctx context.Context, appName string) (models.App, error)
	GetApp(ctx context.Context, appName string) (models.App, error)
	SetApp(ctx context.Context, appName string, appSecret string) (int, error)
	UpdApp(ctx context.Context, appNameOlnd string, appName string, appSecret string) error
	DelApp(ctx context.Context, appName string) error
}

type CreatorProvider

type CreatorProvider interface {
	SetCreator(ctx context.Context, uID uint64, appID int) error
	IsCreator(ctx context.Context, uID uint64, appName string) error
}

type UserProvider

type UserProvider interface {
	GetUser(ctx context.Context, email string) (models.User, error)
}

Jump to

Keyboard shortcuts

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