service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationService

type AuthenticationService interface {
	SignIn(ctx context.Context, email string, password string) (*SignInResponse, error)
	SignOut(ctx context.Context) error
	Me(ctx context.Context) (*MeResponse, error)
}

func NewAuthenticationService

func NewAuthenticationService(jwtDatasource domain.JwtDatasource, hashDatasource domain.HashDatasource, userRepository domain.UserRepository, accessTokenRepository domain.AccessTokenRepository, refreshTokenRepository domain.RefreshTokenRepository, db *sql.DB) AuthenticationService

type CreateNoteResponse

type CreateNoteResponse struct {
	Note *domain.Note `json:"note"`
}

type GetPresignedUrlsResponse

type GetPresignedUrlsResponse struct {
	Urls []PresignedUrl `json:"urls"`
}

GetPresignedUrlsResponse represents the structure of the get presigned urls response

type MeResponse

type MeResponse struct {
	User domain.User `json:"user"`
}

type NoteService

type NoteService interface {
	CreateNote(ctx context.Context, title string, content string, objectNames []string) (*CreateNoteResponse, error)
	ListTrashNotesByUser(ctx context.Context, cursor time.Time) (*[]domain.Note, error)
	ListNotesByUser(ctx context.Context, cursor time.Time) (*[]domain.Note, error)
	RestoreNote(ctx context.Context, id uuid.UUID) (*domain.Note, error)
	DeleteNote(ctx context.Context, id uuid.UUID, hard bool) error
	UpdateNote(ctx context.Context, note *domain.Note) (*domain.Note, error)
	GetPresignedUrls(ctx context.Context, objectNames []string) (*GetPresignedUrlsResponse, error)
}

func NewNoteService

func NewNoteService(noteRepository domain.NoteRepository, oss oss.ObjectStorageService, fileRepository domain.FileRepository, cfg config.Configuration, k8sClient k8sc.K8sC, db *sql.DB) NoteService

type PresignedUrl

type PresignedUrl struct {
	Url      string `json:"url"`
	File     string `json:"file"`
	ObjectId string `json:"object_id"`
}

type SignInResponse

type SignInResponse struct {
	AccessToken  string      `json:"access_token"`
	RefreshToken string      `json:"refresh_token"`
	User         domain.User `json:"user"`
}

Jump to

Keyboard shortcuts

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