repository

package
v0.0.0-...-533d78a Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Dialogue

type Dialogue struct {
	ID       ulid.ULID `gorm:"type:char(26);not null;primaryKey"`
	PageID   ulid.ULID `gorm:"type:char(26);not null"`
	Dialogue string    `gorm:"type:text;not null"`
	Top      float64   `gorm:"type:float;not null"`
	Bottom   float64   `gorm:"type:float;not null"`
	Left     float64   `gorm:"type:float;not null"`
	Right    float64   `gorm:"type:float;not null"`
	Page     Page      `gorm:"foreignKey:PageID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}

type DialoguePageRepository

type DialoguePageRepository interface {
	SelectDialogues(ctx context.Context, pageID ulid.ULID) ([]*Dialogue, error)
}

type DialogueRepository

type DialogueRepository interface {
	InsertDialogue(ctx context.Context, id ulid.ULID, pageID ulid.ULID, dialogue string, top float64, bottom float64, left float64, right float64) (*Dialogue, error)
	UpdateDialogue(ctx context.Context, id ulid.ULID, dialogue string, top float64, bottom float64, left float64, right float64) (*Dialogue, error)
	DeleteDialogue(ctx context.Context, id ulid.ULID) error
}

type Line

type Line struct {
	ID      ulid.ULID `gorm:"type:char(26);not null;primaryKey"`
	PageID  ulid.ULID `gorm:"type:char(26);not null"`
	PenSize int       `gorm:"type:int;not null"`
	Points  Points    `gorm:"type:text;not null"`
	Page    Page      `gorm:"foreignKey:PageID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}

type LinePageRepository

type LinePageRepository interface {
	SelectLines(ctx context.Context, pageID ulid.ULID) ([]*Line, error)
}

type LineRepository

type LineRepository interface {
	InsertLine(ctx context.Context, id ulid.ULID, pageID ulid.ULID, penSize int, points Points) (*Line, error)
	DeleteLine(ctx context.Context, id ulid.ULID) error
}

type Page

type Page struct {
	ID        ulid.ULID `gorm:"type:char(26);not null;primaryKey"`
	ProjectID ulid.ULID `gorm:"type:char(26);not null"`
	Index     int       `gorm:"type:int;not null"`
	Height    int       `gorm:"type:int;not null"`
	Width     int       `gorm:"type:int;not null"`
	Project   Project   `gorm:"foreignKey:ProjectID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE"`
}

type PageRepository

type PageRepository interface {
	SelectProjectPages(ctx context.Context, projectID ulid.ULID) ([]*Page, error)
	InsertPage(ctx context.Context, id ulid.ULID, projectID ulid.ULID, height int, width int) (*Page, error)
	SelectPage(ctx context.Context, id ulid.ULID) (*Page, error)
	UpdateIndex(ctx context.Context, id ulid.ULID, operation string) (*Page, error)
}

type Point

type Point struct {
	X        float64 `json:"x"`
	Y        float64 `json:"y"`
	Pressure float64 `json:"pressure"`
}

type Points

type Points []Point

func (*Points) Scan

func (p *Points) Scan(value interface{}) error

func (Points) Value

func (p Points) Value() (driver.Value, error)

type Project

type Project struct {
	ID        ulid.ULID `gorm:"type:char(26);not null;primaryKey"`
	Name      string    `gorm:"type:varchar(255);not null"`
	Thumbnail string    `gorm:"type:varchar(255);not null"`
	CreatedAt time.Time `gorm:"type:DATETIME;not null;default:CURRENT_TIMESTAMP"`
	UpdatedAt time.Time `gorm:"type:DATETIME;not null;default:CURRENT_TIMESTAMP"`
}

type ProjectPageRepository

type ProjectPageRepository interface {
	SelectProjectPageNum(ctx context.Context, projectID ulid.ULID) (int, error)
	SelectProjectPages(ctx context.Context, projectID ulid.ULID) ([]*Page, error)
}

type ProjectRepository

type ProjectRepository interface {
	SelectProjects(ctx context.Context) ([]*Project, error)
	InsertProject(ctx context.Context, id ulid.ULID, name string, thumbnail string) (*Project, error)
	SelectProject(ctx context.Context, id ulid.ULID) (*Project, error)
	UpdateProject(ctx context.Context, id ulid.ULID, name string) (*Project, error)
	DeleteProject(ctx context.Context, id ulid.ULID) error
}

type Repository

type Repository interface {
	Do(context.Context, *sql.TxOptions, func(context.Context) error) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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