postgres

package
v0.0.0-...-c2832fb Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2016 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBInterface

type DBInterface interface {
	Ping() error
	Exec(query string, args ...interface{}) (sql.Result, error)
	Query(query string, args ...interface{}) (*sql.Rows, error)
	Close() error
}

type MockDBInterface

type MockDBInterface struct {
	mock.Mock
}

func (*MockDBInterface) Close

func (m *MockDBInterface) Close() error

func (*MockDBInterface) Exec

func (m *MockDBInterface) Exec(query string, args ...interface{}) (sql.Result, error)

func (*MockDBInterface) Ping

func (m *MockDBInterface) Ping() error

func (*MockDBInterface) Query

func (m *MockDBInterface) Query(query string, args ...interface{}) (*sql.Rows, error)

type MockResultInterface

type MockResultInterface struct {
	mock.Mock
}

func (*MockResultInterface) LastInsertId

func (m *MockResultInterface) LastInsertId() (int64, error)

func (*MockResultInterface) RowsAffected

func (m *MockResultInterface) RowsAffected() (int64, error)

type Options

type Options struct {
	Start          string
	End            string
	Version        int32
	Type           uint32
	SessionId      string
	AttributeKey   string
	AttributeValue string
	TagKey         string
	TagValue       string
	Order          string
	Limit          uint
}

type Plugin

type Plugin struct {
	DBName      string
	User        string
	Password    string
	Host        string
	Port        string
	SSLMode     string
	Timeout     string
	SSLCert     string
	SSLKey      string
	SSLRootCert string

	Start          string
	End            string
	Version        int32
	Type           uint32
	SessionId      string
	AttributeKey   string
	AttributeValue string
	TagKey         string
	TagValue       string
	Order          string
	Limit          uint

	BufferSize int
}

func (*Plugin) Generator

func (p *Plugin) Generator() (cypress.Generator, error)

func (*Plugin) Receiver

func (p *Plugin) Receiver() (cypress.Receiver, error)

type Postgres

type Postgres struct {
	DB DBInterface
}

func (*Postgres) Close

func (p *Postgres) Close() error

func (*Postgres) Init

func (p *Postgres) Init(db DBInterface)

func (*Postgres) Receive

func (p *Postgres) Receive(m *cypress.Message) error

func (*Postgres) SetupDB

func (p *Postgres) SetupDB() error

type PostgresRecv

type PostgresRecv struct {
	*Postgres
	Options       *Options
	BufferSize    int
	MessageBuffer chan *cypress.Message
}

func NewPostgresRecv

func NewPostgresRecv(postgres *Postgres, options *Options, bufferSize int) (*PostgresRecv, error)

func (*PostgresRecv) BufferMessages

func (pr *PostgresRecv) BufferMessages(messages []*cypress.Message) error

func (*PostgresRecv) BuildStmt

func (pr *PostgresRecv) BuildStmt(o *Options) string

func (*PostgresRecv) Close

func (pr *PostgresRecv) Close() error

func (*PostgresRecv) Generate

func (pr *PostgresRecv) Generate() (*cypress.Message, error)

func (*PostgresRecv) Search

func (pr *PostgresRecv) Search(o *Options) ([]*cypress.Message, error)

type Recv

type Recv struct {
	DBName      string `long:"dbname" description:"The name of the database to connect to"`
	User        string `long:"user" description:"The user to sign in as"`
	Password    string `long:"password" description:"The user's password"`
	Host        string `` /* 126-byte string literal not displayed */
	Port        string `long:"port" description:"The port to bind to. (default is 5432)"`
	SSLMode     string `long:"sslmode" description:"Whether or not to use SSL (default is require, this is not the default for libpq)"`
	Timeout     string `long:"timeout" description:"Maximum wait for connection, in seconds. Zero or not specified means wait indefinitely."`
	SSLCert     string `long:"sslcert" description:"Cert file location. The file must contain PEM encoded data."`
	SSLKey      string `long:"sslkey" description:"Key file location. The file must contain PEM encoded data."`
	SSLRootCert string `long:"sslrootcert" description:"The location of the root certificate file. The file must contain PEM encoded data."`

	Start          string
	End            string
	Version        int32
	Type           uint32
	SessionId      string
	AttributeKey   string
	AttributeValue string
	TagKey         string
	TagValue       string
	Order          string
	Limit          uint

	BufferSize int `long:"buffersize" default:"100"`
}

func (*Recv) Execute

func (g *Recv) Execute(args []string) error

type ResultInterface

type ResultInterface interface {
	LastInsertId() (int64, error)
	RowsAffected() (int64, error)
}

type Send

type Send struct {
	DBName      string `long:"dbname" description:"The name of the database to connect to"`
	User        string `long:"user" description:"The user to sign in as"`
	Password    string `long:"password" description:"The user's password"`
	Host        string `` /* 126-byte string literal not displayed */
	Port        string `long:"port" description:"The port to bind to. (default is 5432)"`
	SSLMode     string `long:"sslmode" description:"Whether or not to use SSL (default is require, this is not the default for libpq)"`
	Timeout     string `long:"timeout" description:"Maximum wait for connection, in seconds. Zero or not specified means wait indefinitely."`
	SSLCert     string `long:"sslcert" description:"Cert file location. The file must contain PEM encoded data."`
	SSLKey      string `long:"sslkey" description:"Key file location. The file must contain PEM encoded data."`
	SSLRootCert string `long:"sslrootcert" description:"The location of the root certificate file. The file must contain PEM encoded data."`
}

func (*Send) Execute

func (p *Send) Execute(args []string) error

Jump to

Keyboard shortcuts

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