model

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DB

func DB() *gorm.DB

func LoadDBWithOptions

func LoadDBWithOptions(options DBOptions)

Types

type DBOptions

type DBOptions struct {
	Reset bool
	Path  string
}

func (*DBOptions) DBPath

func (o *DBOptions) DBPath() string

func (*DBOptions) ShouldReset

func (o *DBOptions) ShouldReset() bool

type Interaction

type Interaction struct {
	gorm.Model

	PayloadID uint    `json:"payload_id"`
	Payload   Payload `json:"payload"`

	ProjectID uint    `json:"project_id"`
	Project   Project `json:"project"`

	RemoteAddr string `json:"remote_addr"`
	RemotePort string `json:"remote_port"`
	Data       []byte `json:"data"`
}

type Payload

type Payload struct {
	Name             string `json,yaml:"name" gorm:"unique"`
	Description      string `json,yaml:"description"`
	Type             string `json,yaml:"type"`
	IsFinal          bool   `json,yaml:"is_final"`
	SortOrder        int    `yaml:"sort_order"`
	Pattern          string `json,yaml:"pattern"`
	InternalFunction string `json,yaml:"internal_function"`
	Data             string `json,yaml:"data"`

	ProjectID uint     `json,yaml:"project_id"`
	Project   *Project `yaml:"-" yaml:"-"`

	gorm.Model
	// contains filtered or unexported fields
}

func SortedPayloads

func SortedPayloads() []Payload

func (*Payload) PatternRegexp

func (p *Payload) PatternRegexp() *regexp.Regexp

type Project

type Project struct {
	gorm.Model

	Name    string `gorm:"unique"`
	Code    string `gorm:"unique"`
	Default bool   `gorm:"default:false"`
}

func DefaultProject

func DefaultProject() *Project

Jump to

Keyboard shortcuts

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