snippet

package
v0.0.0-...-60eee74 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Snippet

type Snippet struct {
	ID          int                `json:"id"`
	Link        string             `json:"link"`
	Title       string             `json:"title"`
	Language    string             `json:"language"`
	Code        string             `json:"code"`
	AuthorID    int                `json:"author_id"`
	IsAnonymous bool               `json:"is_anonymous"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
}

type Storage

type Storage interface {
	Create(ctx context.Context, snippet *Snippet) error
	GetByLink(ctx context.Context, link string) (*Snippet, error)
	GetByID(ctx context.Context, id int) (*Snippet, error)
	UpdateSnippet(ctx context.Context, snippet Snippet) error
	DeleteByID(ctx context.Context, id string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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