services

package
v0.0.0-...-9ade0de Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetIdProvider

func SetIdProvider(provider IdProvider)

Types

type ClassRepository

type ClassRepository interface {
	CreateClass(context.Context, *models.Class) error
	DeleteClass(context.Context, string) error
	GetClassById(context.Context, string) (models.Class, error)
	GetClassList(context.Context, models.ClassFilter) ([]models.Class, models.Range, error)
	UpdateClass(context.Context, *models.Class) error
}

type ClassService

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

func NewClassService

func NewClassService(repo ClassRepository) ClassService

func (ClassService) All

func (s ClassService) All(ctx context.Context) (classes []models.Class, err error)

func (ClassService) ById

func (s ClassService) ById(ctx context.Context, id string) (models.Class, error)

func (ClassService) Create

func (s ClassService) Create(ctx context.Context, class *models.Class) (err error)

func (ClassService) Delete

func (s ClassService) Delete(ctx context.Context, id string) (err error)

func (ClassService) List

func (ClassService) Update

func (s ClassService) Update(ctx context.Context, class *models.Class) (err error)

type DocumentRepository

type DocumentRepository interface {
	CreateDocument(context.Context, *models.Document) error
	DeleteDocument(context.Context, string) error
	GetDocumentById(context.Context, string) (models.Document, error)
	GetDocumentByPath(context.Context, string) (models.Document, error)
	GetDocumentList(context.Context, models.DocumentFilter) ([]models.Document, models.Range, error)
	UpdateDocument(context.Context, *models.Document) error
}

type DocumentService

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

func NewDocumentService

func NewDocumentService(repo DocumentRepository) DocumentService

func (DocumentService) ById

func (DocumentService) ByPath

func (s DocumentService) ByPath(ctx context.Context, path string) (models.Document, error)

func (DocumentService) Create

func (s DocumentService) Create(ctx context.Context, doc *models.Document) (err error)

func (DocumentService) Delete

func (s DocumentService) Delete(ctx context.Context, id string) (err error)

func (DocumentService) List

func (DocumentService) Update

func (s DocumentService) Update(ctx context.Context, doc *models.Document) (err error)

type FileRepository

type FileRepository interface {
	CreateFile(context.Context, *models.File) (string, error)
	CreateUploadUrl(context.Context, models.FileUploadRequest) (models.FileUploadResponse, error)
}

type FileService

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

func NewFileService

func NewFileService(repo FileRepository) FileService

func (FileService) CreateFile

func (s FileService) CreateFile(ctx context.Context, file *models.File) (location string, err error)

func (FileService) UploadUrl

type FormRepository

type FormRepository interface {
	CreateForm(context.Context, *models.Form) error
	DeleteForm(context.Context, string) error
	GetFormById(context.Context, string) (models.Form, error)
	GetFormList(context.Context, models.FormFilter) ([]models.Form, models.Range, error)
	UpdateForm(context.Context, *models.Form) error
}

type FormService

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

func NewFormService

func NewFormService(repo FormRepository) FormService

func (FormService) ById

func (s FormService) ById(ctx context.Context, id string) (models.Form, error)

func (FormService) Create

func (s FormService) Create(ctx context.Context, form *models.Form) (err error)

func (FormService) Delete

func (s FormService) Delete(ctx context.Context, id string) (err error)

func (FormService) List

func (FormService) Update

func (s FormService) Update(ctx context.Context, form *models.Form) (err error)

type IdProvider

type IdProvider interface {
	NewWithTime(time.Time) string
	IsValid(string) bool
}

type TemplateRepository

type TemplateRepository interface {
	CreateTemplate(context.Context, *models.Template) error
	DeleteTemplate(context.Context, string) error
	GetTemplateById(context.Context, string) (models.Template, error)
	GetTemplateList(context.Context, models.TemplateFilter) ([]models.Template, models.Range, error)
	UpdateTemplate(context.Context, *models.Template) error
}

type TemplateService

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

func NewTemplateService

func NewTemplateService(repo TemplateRepository) TemplateService

func (TemplateService) ById

func (TemplateService) Create

func (s TemplateService) Create(ctx context.Context, template *models.Template) (err error)

func (TemplateService) Delete

func (s TemplateService) Delete(ctx context.Context, id string) (err error)

func (TemplateService) List

func (TemplateService) Update

func (s TemplateService) Update(ctx context.Context, template *models.Template) (err error)

type XidProvider

type XidProvider struct{}

func (XidProvider) IsValid

func (p XidProvider) IsValid(id string) bool

func (XidProvider) NewWithTime

func (p XidProvider) NewWithTime(t time.Time) string

Jump to

Keyboard shortcuts

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