base

package
v0.0.0-...-cb58b1f Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DESTINATIONS_TABLE_NAME = "destinations"

Variables

This section is empty.

Functions

func Die

func Die(args ...interface{})

func Logger

func Logger() *logging.Logger

func LoggerWithLevel

func LoggerWithLevel(levelStr string) *logging.Logger

Types

type AbstractGarinDB

type AbstractGarinDB struct {
	// contains filtered or unexported fields
}

func (*AbstractGarinDB) Close

func (self *AbstractGarinDB) Close()

func (*AbstractGarinDB) Open

func (self *AbstractGarinDB) Open()

func (*AbstractGarinDB) RecordDestination

func (self *AbstractGarinDB) RecordDestination(destination *Destination)

func (*AbstractGarinDB) Setup

func (self *AbstractGarinDB) Setup(dbType string, dbArgs string)

type Destination

type Destination struct {
	SourceIp      string    `db:"source_ip"`
	DestinationIp string    `db:"destination_ip"`
	ServerName    string    `db:"server_name"`
	Protocol      string    `db:"protocol"`
	Timestamp     time.Time `db:"timestamp"`
}

func NewDestination

func NewDestination(serverName string, sourceIp string, destIp string) *Destination

func (*Destination) Hash

func (self *Destination) Hash() string

func (*Destination) Save

func (self *Destination) Save(db GarinDB)

type GarinDB

type GarinDB interface {
	Setup(string, string)
	Open()
	Close()
	RecordDestination(*Destination)
}

func NewGarinDB

func NewGarinDB(dbType string, dbArgs string) GarinDB

type MongoGarinDB

type MongoGarinDB struct {
	AbstractGarinDB
	Session *mgo.Session
}

func (*MongoGarinDB) Close

func (self *MongoGarinDB) Close()

func (*MongoGarinDB) Open

func (self *MongoGarinDB) Open()

func (*MongoGarinDB) RecordDestination

func (self *MongoGarinDB) RecordDestination(destination *Destination)

type SQLGarinDB

type SQLGarinDB struct {
	AbstractGarinDB
	Handle *sqlx.DB
}

func (*SQLGarinDB) Close

func (self *SQLGarinDB) Close()

func (*SQLGarinDB) Open

func (self *SQLGarinDB) Open()

func (*SQLGarinDB) RecordDestination

func (self *SQLGarinDB) RecordDestination(destination *Destination)

Jump to

Keyboard shortcuts

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