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
}
Click to show internal directories.
Click to hide internal directories.