store

package
v0.0.0-...-db93d88 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeBox
	TypeAlias
)

Variables

View Source
var CreateSql = []string{`create table if not exists dest (
	id integer primary key autoincrement,
	type integer,
	name text,
	domain text,
	enable integer default 1,
	passwd text,
	forwrd text,
	unique (name, domain)
)`}
View Source
var DeleteSql = `delete from dest %s`
View Source
var DestsSql = `select
	id, type, name, domain, enable, passwd, forwrd
	from dest %s order by domain, name
`
View Source
var DomainsSql = `select
	distinct domain
	from dest %s order by domain
`
View Source
var InsertSql = `insert into dest
	(type, name, domain, passwd, forwrd)
	values (?, ?, ?, ?, ?)
`

Functions

func Create

func Create(db *sql.DB) error

func Delete

func Delete(db *sql.DB, where string, args ...interface{}) error

func Domains

func Domains(db *sql.DB, where string, args ...interface{}) ([]string, error)

func NewAlias

func NewAlias(db *sql.DB, name, domain, forwrd string) error

func NewBox

func NewBox(db *sql.DB, name, domain, passwd string) error

Types

type Dest

type Dest struct {
	Id     int64
	Type   int
	Name   string
	Domain string
	Enable bool
	Passwd string
	Forwrd string
}

func Dests

func Dests(db *sql.DB, where string, args ...interface{}) ([]Dest, error)

func (*Dest) String

func (d *Dest) String() string

Jump to

Keyboard shortcuts

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