server

package
v0.0.0-...-4a77654 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToJQ

func ToJQ(s *Snippet) *jq.JQ

Types

type DB

type DB struct {
	*sqlx.DB
}

func ConnectDB

func ConnectDB(url string) (*DB, error)

func (*DB) GetSnippet

func (db *DB) GetSnippet(id string) (*Snippet, error)

func (*DB) UpsertSnippet

func (db *DB) UpsertSnippet(s *Snippet) (string, error)

type JQHandler

type JQHandler struct {
	DB     *DB
	Config *config.Config
}

type JQHandlerContext

type JQHandlerContext struct {
	*config.Config
	JQ string
}

func (*JQHandlerContext) Asset

func (c *JQHandlerContext) Asset(path string) string

func (*JQHandlerContext) ShouldInitJQ

func (c *JQHandlerContext) ShouldInitJQ() bool

type Server

type Server struct {
	Config *config.Config
}

func New

func New(c *config.Config) *Server

func (*Server) Start

func (s *Server) Start() error

type Snippet

type Snippet struct {
	J string `db:"j"`
	Q string `db:"q"`
	O string `db:"o"`
}

func FromJQ

func FromJQ(jq *jq.JQ) *Snippet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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