Documentation ¶
Index ¶
- Variables
- type Memory
- func (m *Memory) AddComment(comment types.Comment) (types.CommentId, error)
- func (m *Memory) AddSnippet(snippet types.Snippet) (types.SnippetId, error)
- func (m *Memory) CreateAccount(cred auth.Credentials) (auth.Account, error)
- func (m *Memory) DeleteComment(comment types.CommentId) error
- func (m *Memory) DeleteSnippet(snippet types.SnippetId) error
- func (m *Memory) GetAccountById(id uint) (auth.Account, error)
- func (m *Memory) GetAccountByUsername(username string) (auth.Account, error)
- func (m *Memory) GetComment(comment types.CommentId) (types.Comment, error)
- func (m *Memory) GetComments(snippet types.SnippetId) ([]types.Comment, error)
- func (m *Memory) GetSnippet(snippet types.SnippetId) (types.Snippet, error)
- func (m *Memory) GetSnippetsByLanguage(language types.ProgrammingLanguage) ([]types.Snippet, error)
- func (m *Memory) GetSnippetsByUser(user types.UserId) ([]types.Snippet, error)
- func (m *Memory) GetVote(user types.UserId, snippet types.SnippetId) (int, error)
- func (m *Memory) Vote(user types.UserId, snippet types.SnippetId, vote int) error
- type Postgres
- func (p Postgres) AddComment(comment types.Comment) (types.CommentId, error)
- func (p Postgres) AddSnippet(snippet types.Snippet) (types.SnippetId, error)
- func (p Postgres) Close() error
- func (p Postgres) CreateAccount(cred auth.Credentials) (auth.Account, error)
- func (p Postgres) DeleteComment(comment types.CommentId) error
- func (p Postgres) DeleteSnippet(snippet types.SnippetId) error
- func (p Postgres) GetAccountById(id uint) (auth.Account, error)
- func (p Postgres) GetAccountByUsername(username string) (auth.Account, error)
- func (p Postgres) GetComment(comment types.CommentId) (types.Comment, error)
- func (p Postgres) GetComments(snippet types.SnippetId) ([]types.Comment, error)
- func (p Postgres) GetSnippet(snippet types.SnippetId) (types.Snippet, error)
- func (p Postgres) GetSnippetsByLanguage(language types.ProgrammingLanguage) ([]types.Snippet, error)
- func (p Postgres) GetSnippetsByUser(user types.UserId) ([]types.Snippet, error)
- func (p Postgres) GetVote(user types.UserId, snippet types.SnippetId) (int, error)
- func (p Postgres) SetSnippetHighlight(snippet types.SnippetId, highlight string) error
- func (p Postgres) Vote(user types.UserId, snippet types.SnippetId, vote int) error
- type SnippetVote
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func (*Memory) AddComment ¶
func (*Memory) AddSnippet ¶
func (*Memory) CreateAccount ¶
func (*Memory) GetAccountByUsername ¶
func (*Memory) GetComment ¶
func (*Memory) GetComments ¶
func (*Memory) GetSnippet ¶
func (*Memory) GetSnippetsByLanguage ¶
func (*Memory) GetSnippetsByUser ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func NewPostgres ¶
func (Postgres) AddComment ¶
func (Postgres) AddSnippet ¶
func (Postgres) CreateAccount ¶
func (Postgres) GetAccountByUsername ¶
func (Postgres) GetComment ¶
func (Postgres) GetComments ¶
func (Postgres) GetSnippet ¶
func (Postgres) GetSnippetsByLanguage ¶
func (Postgres) GetSnippetsByUser ¶
func (Postgres) SetSnippetHighlight ¶
Click to show internal directories.
Click to hide internal directories.