xsqldb

package
v0.0.0-...-aaf6028 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Deprecated.

Index

Constants

This section is empty.

Variables

View Source
var MsSqlDialect = &Dialect{
	Binary: "varbinary",
	Int64:  "bigint",
	Date:   "date",
	Byte:   "tinyint",
}

Microsoft SQL Server (untested)

View Source
var PgDialect = &Dialect{
	Binary: "bytea",
	Int64:  "bigint",
	Date:   "date",
	Byte:   "smallint",
}

PostgreSQL

Functions

This section is empty.

Types

type AuthBase

type AuthBase struct {
	Base
	Rank AuthRank
}

This must be used to implement GroupHeadCache.

func (*AuthBase) GroupHeadFilter

func (b *AuthBase) GroupHeadFilter(groups [][]byte) ([][]byte, error)

type AuthRank

type AuthRank uint8
const (
	ARReader AuthRank = iota
	ARUser
	ARModerator
	ARFeeder
)

type Base

type Base struct {
	DB *sql.DB
}

func (*Base) AdmPutDescr

func (b *Base) AdmPutDescr(group []byte, descr []byte)

func (*Base) AdmPutStatus

func (b *Base) AdmPutStatus(group []byte, status byte)

func (*Base) CreateTables

func (b *Base) CreateTables(d *Dialect) error

func (*Base) Expire

func (b *Base) Expire(expire time.Time) error

func (*Base) GroupHeadInsert

func (b *Base) GroupHeadInsert(groups [][]byte, buf []int64) (nums []int64, e error)

func (*Base) GroupHeadRevert

func (b *Base) GroupHeadRevert(groups [][]byte, nums []int64) error

func (*Base) GroupRealtimeList

func (b *Base) GroupRealtimeList(targ func(group []byte, high, low int64, status byte)) bool

func (*Base) GroupRealtimeQuery

func (b *Base) GroupRealtimeQuery(group []byte) (number int64, low int64, high int64, ok bool)

func (*Base) GroupStaticList

func (b *Base) GroupStaticList(targ func(group []byte, descr []byte)) bool

func (*Base) InsertGoupMapping

func (b *Base) InsertGoupMapping(group []byte, num int64, msgid []byte, expire time.Time) error

func (*Base) InsertIDMapping

func (b *Base) InsertIDMapping(msgid, bucket []byte, expire time.Time) error

func (*Base) QueryGroupList

func (b *Base) QueryGroupList(group []byte, first, last int64, targ func(num int64, bucket, msgid bufferex.Binary)) error

func (*Base) QueryGroupMapping

func (b *Base) QueryGroupMapping(group []byte, num int64) (msgid, bucket bufferex.Binary, err error)

func (*Base) QueryGroupShift

func (b *Base) QueryGroupShift(group []byte, num int64, backward bool) (nxt int64, msgid bufferex.Binary, err error)

func (*Base) QueryIDMapping

func (b *Base) QueryIDMapping(msgid []byte) (bucket bufferex.Binary, err error)

type Dialect

type Dialect struct {
	Binary, Int64, Date, Byte string
}

type PgBase

type PgBase struct {
	Base
}

This is for PostgreSQL only. This must not be used with any other Database.

func (*PgBase) GroupHeadInsert

func (b *PgBase) GroupHeadInsert(groups [][]byte, buf []int64) (nums []int64, e error)

PostgreSQL specific variant/Optimization

Jump to

Keyboard shortcuts

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