answer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entries

type Entries struct {
	Storage StorageInterface
}

func NewAnswerStorage

func NewAnswerStorage(store StorageInterface) *Entries

func (*Entries) Insert

func (es *Entries) Insert(e *Entry, logger *slog.Logger) error

func (*Entries) Update

func (es *Entries) Update(e *Entry, logger *slog.Logger) error

type Entry

type Entry struct {
	ID         *int64     `json:"id"`
	Username   string     `json:"username"`
	Text       string     `json:"text"`
	AvatarFile string     `json:"avatar_file"`
	Url        string     `json:"url"`
	Role       string     `json:"role"`
	Datetime   *time.Time `json:"datetime"`
	DataID     int64      `json:"data_id,omitempty"`
	ParentID   int64      `json:"parent_id,omitempty"`
	Type       int        `json:"type"`
	Position   int        `json:"position"`
}

type StorageInterface

type StorageInterface interface {
	FindAllByUrl(ctx context.Context, url string) (*[]Entry, error)
	Insert(ctx context.Context, entry *Entry) (*int64, error)
	Update(ctx context.Context, entry *Entry) error
}

Jump to

Keyboard shortcuts

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