repository

package
v1.0.0-main.22 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ChapterCollection = "chapters"
View Source
const ProjectCollection = "projects"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChapterRepository

type ChapterRepository interface {
	FetchProjectChapters(projectId string) (map[string]record.ChapterEntry, *Error)
}

func NewChapterRepository

func NewChapterRepository(client firestore.Client) ChapterRepository

type Error

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

func Errorf

func Errorf(code ErrorCode, format string, args ...any) *Error

func (Error) Code

func (e Error) Code() ErrorCode

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() error

type ErrorCode

type ErrorCode string
const (
	NotFoundError     ErrorCode = "not found"
	ReadFailurePanic  ErrorCode = "read failure"
	WriteFailurePanic ErrorCode = "write failure"
)

type ProjectRepository

type ProjectRepository interface {
	FetchUserProjects(userId string) (map[string]record.ProjectEntry, *Error)
	FetchProject(projectId string) (*record.ProjectEntry, *Error)
	InsertProject(entry record.ProjectWithoutAutofieldEntry) (string, *record.ProjectEntry, *Error)
	UpdateProject(projectId string, entry record.ProjectWithoutAutofieldEntry) (*record.ProjectEntry, *Error)
}

func NewProjectRepository

func NewProjectRepository(client firestore.Client) ProjectRepository

Jump to

Keyboard shortcuts

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