services

package
v0.0.0-...-adb56df Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageProcessService

type ImageProcessService interface {
	CreateThumbnails(ctx context.Context, photoFile *entities.PhotoFile, data []byte, orientation int) error
}

type OAuthService

type OAuthService interface {
	PublishUserAccessToken(ctx context.Context, client *entities.OauthClient, userID string) (string, int64, error)
	PublishCCAccessToken(ctx context.Context, client *entities.OauthClient) (string, int64, error)
	GetSession(ctx context.Context, accessToken string) (*entities.OauthSession, error)
	AuthByRefreshToken(ctx context.Context, clientID, refreshToken string) (*entities.UserAuth, error)
	UpsertUserAuth(ctx context.Context, clientID, userID string, now time.Time) (string, error)
	AuthCode(ctx context.Context, client *entities.OauthClient, code, redirectURL string) (*entities.OAuthCode, error)
	PublishAuthCode(ctx context.Context, clientID, userID, redirectURL string) (string, error)
	AuthClient(ctx context.Context, clientID, clientSecret string) (*entities.OauthClient, error)
	CreateClientWithClientSecret(ctx context.Context, client *entities.OauthClient, clientSecret string) error
	CreateClient(ctx context.Context, client *entities.OauthClient) (*entities.OauthClient, string, error)
	ValidateToCreateClient(ctx context.Context, client *entities.OauthClient) error
	GetUserClient(ctx context.Context, clientID string) (*entities.OauthClient, error)
	GetOAuthClientRedirectURLsByOAuthClientID(ctx context.Context, clientID string) (entities.OAuthClientRedirectURLList, error)
	ValidateRedirectURL(ctx context.Context, clientID, redirectURL string) error
}

func NewOAuthService

func NewOAuthService(
	passwordService PasswordService,
	authAdapter infrastructures.OAuthAdapter,
) OAuthService

type PasswordService

type PasswordService interface {
	HashPassword(password string) (string, error)
	MatchPassword(password string, hash string) (bool, error)
	GeneratePassword(length int) (string, error)
}

func NewPasswordService

func NewPasswordService() PasswordService

type PhotoService

type PhotoService interface {
	ShouldSkipToRegisterPhoto(ctx context.Context, filePath, fileHash string) (bool, error)
	RegisterPhoto(ctx context.Context, filePath, fileHash string) (*entities.Photo, error)
}

type UserService

type UserService interface {
	AuthUserPassword(ctx context.Context, userID, password string) error
}

func NewUserService

func NewUserService(
	userAdapter infrastructures.UserAdapter,
	passwordService PasswordService,
) UserService

Jump to

Keyboard shortcuts

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