models

package
v0.0.0-...-a4a1dc1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SQL_MODEL_COUNT = `SELECT count(%s) AS count FROM %s`
)

Variables

This section is empty.

Functions

func CountRows

func CountRows(tableName, columnName string, txn *gorp.Transaction) (int64, error)

func DefineCategoryTable

func DefineCategoryTable(dbm *gorp.DbMap)

func DefineDeviceTable

func DefineDeviceTable(dbm *gorp.DbMap)

func DefineFileTable

func DefineFileTable(dbm *gorp.DbMap)

func DefineHostTable

func DefineHostTable(dbm *gorp.DbMap)

func DefineLogTable

func DefineLogTable(dbm *gorp.DbMap)

func DefineLoglevelTable

func DefineLoglevelTable(dbm *gorp.DbMap)

func DefineLogtypeTable

func DefineLogtypeTable(dbm *gorp.DbMap)

func DefineProfileTable

func DefineProfileTable(dbm *gorp.DbMap)

func DefineServiceTable

func DefineServiceTable(dbm *gorp.DbMap)

func DefineUserTable

func DefineUserTable(dbm *gorp.DbMap)

func DefineUtmstatusTable

func DefineUtmstatusTable(dbm *gorp.DbMap)

func DefineVirusTable

func DefineVirusTable(dbm *gorp.DbMap)

func DefineVirusdefTable

func DefineVirusdefTable(dbm *gorp.DbMap)

func DefineWebfilterTable

func DefineWebfilterTable(dbm *gorp.DbMap)

func InitAllTables

func InitAllTables(dbm *gorp.DbMap) error

func InitLoglevelTable

func InitLoglevelTable(txn *gorp.Transaction)

func InitUtmstatusTable

func InitUtmstatusTable(txn *gorp.Transaction)

func SetNotNull

func SetNotNull(cm *gorp.TableMap, colName ...string)

Types

type Category

type Category struct {
	Id          int64  `db:"id"`
	Description string `db:"description"`
}

type Device

type Device struct {
	Id     int64  `db:"id"`
	Name   string `db:"name"`
	Serial string `db:"serial"`
}

type File

type File struct {
	Id    int64     `db:"id"`
	Begin time.Time `db:"begin_dt"`
	End   time.Time `db:"end_dt"`
	Count int64     `db:"count_lines"`
}

type Host

type Host struct {
	Id         int64  `db:"id"`
	Name       string `db:"name"`
	CategoryId *int64 `db:"category"`

	Category *Category `db:"-"`
}

func (*Host) PostGet

func (self *Host) PostGet(exe gorp.SqlExecutor) error

func (*Host) PreInsert

func (self *Host) PreInsert(gorp.SqlExecutor) error

func (*Host) PreUpdate

func (self *Host) PreUpdate(exe gorp.SqlExecutor) error

type Log

type Log struct {
	Id           int64     `db:"id"`
	FileId       int64     `db:"file"`
	LogtypeId    int64     `db:"logtype"`
	DeviceId     int64     `db:"device"`
	LevelId      int64     `db:"level"`
	UserId       int64     `db:"user"`
	ServiceId    int64     `db:"service"`
	LogId        int64     `db:"log_id"`
	Date         time.Time `db:"date"`
	SessionId    int64     `db:"session_id"`
	PolicyId     int64     `db:"policy_id"`
	SourceIp     string    `db:"source_ip"`
	SourceIf     string    `db:"source_if"`
	DestIp       string    `db:"dest_ip"`
	DestPort     uint16    `db:"dest_port"`
	DestIf       string    `db:"dest_if"`
	SentByte     uint64    `db:"sent_byte"`
	ReceivedByte uint64    `db:"received_byte"`
	Message      *string   `db:"message"`

	File    *File     `db:"-"`
	LogType *LogType  `db:"-"`
	Device  *Device   `db:"-"`
	Level   *LogLevel `db:"-"`
	User    *User     `db:"-"`
	Service *Service  `db:"-"`
}

func (*Log) PostGet

func (self *Log) PostGet(exe gorp.SqlExecutor) error

func (*Log) PreInsert

func (self *Log) PreInsert(gorp.SqlExecutor) error

type LogLevel

type LogLevel struct {
	Id   int64  `db:"id"`
	Name string `db:"name"`
}

type LogType

type LogType struct {
	Id     int64  `db:"id"`
	Level1 string `db:"level1"`
	Level2 string `db:"level2"`
}

type Profile

type Profile struct {
	Id   int64  `db:"id"`
	Name string `db:"name"`
}

type Service

type Service struct {
	Id   int64  `db:"id"`
	Name string `db:"name"`
}

type User

type User struct {
	Id   int64  `db:"id"`
	Name string `db:"name"`
}

type UtmStatus

type UtmStatus struct {
	Id   int64  `db:"id"`
	Name string `db:"name"`
}

type Virus

type Virus struct {
	Id         int64  `db:"id"`
	StatusId   int64  `db:"status"`
	VirusDefId int64  `db:"virusdef"`
	Url        string `db:"url"`

	Log      *Log      `db:"-"`
	VirusDef *VirusDef `db:"-"`
}

func (*Virus) PostGet

func (self *Virus) PostGet(exe gorp.SqlExecutor) error

func (*Virus) PreInsert

func (self *Virus) PreInsert(gorp.SqlExecutor) error

type VirusDef

type VirusDef struct {
	Id   int64  `db:"id"`
	Name string `db:"name"`
}

type WebFilter

type WebFilter struct {
	Id         int64  `db:"id"`
	ProfileId  int64  `db:"profile"`
	StatusId   int64  `db:"status"`
	HostId     int64  `db:"host"`
	CategoryId *int64 `db:"category"`
	Url        string `db:"url"`

	Log      *Log       `db:"-"`
	Profile  *Profile   `db:"-"`
	Status   *UtmStatus `db:"-"`
	Host     *Host      `db:"-"`
	Category *Category  `db:"-"`
}

func (*WebFilter) PostGet

func (self *WebFilter) PostGet(exe gorp.SqlExecutor) error

func (*WebFilter) PreInsert

func (self *WebFilter) PreInsert(gorp.SqlExecutor) error

Jump to

Keyboard shortcuts

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