Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Handle defines the global database handle Handle *gorm.DB )
Functions ¶
func GetDefaultSession ¶
func GetDefaultSession() (*gorm.DB, context.CancelFunc)
GetDefaultSession returns a database session with the default timeout. Don't forget to cancel the returned context
Types ¶
type FsEvent ¶
type FsEvent struct { ID string `json:"id" gorm:"primaryKey"` Timestamp int64 `json:"timestamp"` Action string `json:"action"` Username string `json:"username"` FsPath string `json:"fs_path"` FsTargetPath string `json:"fs_target_path,omitempty"` VirtualPath string `json:"virtual_path"` VirtualTargetPath string `json:"virtual_target_path,omitempty"` SSHCmd string `json:"ssh_cmd,omitempty"` FileSize int64 `json:"file_size,omitempty"` Elapsed int64 `json:"elapsed,omitempty"` Status int `json:"status"` Protocol string `json:"protocol"` IP string `json:"ip,omitempty"` SessionID string `json:"session_id"` FsProvider int `json:"fs_provider"` Bucket string `json:"bucket,omitempty"` Endpoint string `json:"endpoint,omitempty"` OpenFlags int `json:"open_flags,omitempty"` Role string `json:"role,omitempty"` InstanceID string `json:"instance_id,omitempty"` }
FsEvent defines a filesystem event
func (*FsEvent) BeforeCreate ¶
BeforeCreate implements gorm hook
type LogEvent ¶ added in v1.0.7
type LogEvent struct { ID string `json:"id" gorm:"primaryKey"` Timestamp int64 `json:"timestamp"` Event int `json:"event"` Protocol string `json:"protocol,omitempty"` Username string `json:"username,omitempty"` IP string `json:"ip,omitempty"` Message string `json:"message,omitempty"` Role string `json:"role,omitempty"` InstanceID string `json:"instance_id,omitempty"` }
LogEvent defines a log event
func (*LogEvent) BeforeCreate ¶ added in v1.0.7
BeforeCreate implements gorm hook
type Notifier ¶
type Notifier struct {
InstanceID string
}
func (*Notifier) NotifyLogEvent ¶ added in v1.0.7
func (*Notifier) NotifyProviderEvent ¶
func (n *Notifier) NotifyProviderEvent(event *notifier.ProviderEvent) error
type ProviderEvent ¶
type ProviderEvent struct { ID string `json:"id" gorm:"primaryKey"` Timestamp int64 `json:"timestamp"` Action string `json:"action"` Username string `json:"username"` IP string `json:"ip,omitempty"` ObjectType string `json:"object_type"` ObjectName string `json:"object_name"` ObjectData []byte `json:"object_data"` Role string `json:"role,omitempty"` InstanceID string `json:"instance_id,omitempty"` }
ProviderEvent defines a provider event
func (*ProviderEvent) BeforeCreate ¶
func (ev *ProviderEvent) BeforeCreate(_ *gorm.DB) (err error)
BeforeCreate implements gorm hook
func (*ProviderEvent) Create ¶
func (ev *ProviderEvent) Create(tx *gorm.DB) error
Create persists the object
func (*ProviderEvent) TableName ¶
func (ev *ProviderEvent) TableName() string
TableName defines the database table name
Click to show internal directories.
Click to hide internal directories.