repository

package
v0.0.0-...-fc33bc3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

func NewRepository

func NewRepository(client *ent.Client, logger *logger.Logger) *Repository

func (*Repository) CreateSentence

func (r *Repository) CreateSentence(ctx context.Context, sentence *domain.Sentence) (*domain.Sentence, error)

CreateSentence creates sentence if sentence structs has a non-zero sentence.StoryID.

func (*Repository) CreateStory

func (r *Repository) CreateStory(ctx context.Context, newStory *domain.Story) (*domain.Story, error)

CreateStory creates new empty story (without sentences)

func (*Repository) CreateUser

func (r *Repository) CreateUser(ctx context.Context, ip string) (*domain.User, error)

func (*Repository) GetStory

func (r *Repository) GetStory(ctx context.Context, id uuid.UUID) (*domain.Story, error)

GetStory gets story with all it's sentences

func (*Repository) GetUser

func (r *Repository) GetUser(ctx context.Context, cookieUUID uuid.UUID, ip string) (*domain.User, error)

func (*Repository) UpdateStory

func (r *Repository) UpdateStory(ctx context.Context, newStory *domain.Story) (*domain.Story, error)

UpdateStore updates any fields of the story (status etc)

Jump to

Keyboard shortcuts

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