snippet

package
v0.0.0-...-2033d17 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(queries *store.Queries) serviceImpl

Types

type Language

type Language struct {
	ID   int64  `json:"-"`
	Name string `json:"name"`
}

func NewLanguage

func NewLanguage(id int64, name string) Language

type Service

type Service interface {
	GetLanguage(ctx context.Context, id int64) (Language, error)
	GetLanguageByName(ctx context.Context, name string) (Language, error)

	GetSnippet(ctx context.Context, key string) (Snippet, error)
	AddSnippet(ctx context.Context, content string, langauge Language) (Snippet, error)
}

type Snippet

type Snippet struct {
	ID       int64    `json:"-"`
	Key      string   `json:"key"`
	Content  string   `json:"content"`
	Language Language `json:"language"`
}

func NewSnippet

func NewSnippet(id int64, key string, content string, language Language) Snippet

Jump to

Keyboard shortcuts

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