model

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENTITY_SERVER             = 0
	ENTITY_USER               = 1
	ENTITY_APPLIANCE          = 2
	ENTITY_DEFAULTTEMPLATE_ID = 1
	ENTITY_DEFAULTFIREWALL_ID = 1
)
View Source
const (
	ROLE_SYSTEM        = "SYSTEM"
	ROLE_ADMINISTRATOR = "ADMINISTRATOR"
	ROLE_USER          = "USER"
)

define roles in system

Variables

This section is empty.

Functions

func Connection

func Connection() *gorm.DB

func CreateCRL

func CreateCRL(db *gorm.DB)

func CreateDNS

func CreateDNS(db *gorm.DB)

func DacAccessCheckOrCreateForUser

func DacAccessCheckOrCreateForUser(logupn string, user_access_id int, client_id string, device_name string, device_os string, client_version string) (err error)

func DacAccessConvertUserAccessIdToAccessId

func DacAccessConvertUserAccessIdToAccessId(user_access_id int, client_id string) (aid int, err error)

func DacAccessDelete

func DacAccessDelete(id int, logupn string) (err error)

func DacAccessSave

func DacAccessSave(logupn string, dest *Access, orig *Access) (err error)

func DacAccessSaveDeviceStatisticsForDevice

func DacAccessSaveDeviceStatisticsForDevice(logupn string, access_id int, device_name string, device_os string, client_version string) (err error)

func DacAccessSaveNote

func DacAccessSaveNote(logupn string, id int, note string) (err error)

func DacAdminDashboardStats

func DacAdminDashboardStats() (users int, servers int, usersInvited int, err error)

func DacCheckUpnForAccess

func DacCheckUpnForAccess(upn string, AccessId int) (err error)

func DacCheckUpnForUserAccess

func DacCheckUpnForUserAccess(upn string, UserAccessId int) (err error)

func DacCleanAccessStats

func DacCleanAccessStats()

func DacCleanDeviceLog

func DacCleanDeviceLog()

func DacEntityCheckLoginInfo

func DacEntityCheckLoginInfo(u *Entity, cc *myjwt.CustomClaimsShieldoo, roles []string) error

func DacEntityDelete

func DacEntityDelete(id int, logupn string) (err error)

func DacEntitySave

func DacEntitySave(logupn string, dest *Entity, orig *Entity) (err error)

func DacEntityServerSave

func DacEntityServerSave(logupn string, dest *Entity, orig *Entity, destAcc *Access, origAcc *Access) (err error)

func DacEntitySetName

func DacEntitySetName(id int, name string) error

func DacEntitySetOrigin

func DacEntitySetOrigin(id int, origin string) error

func DacFirstAccessIdByEntityID

func DacFirstAccessIdByEntityID(eid int) (int, error)

func DacFwconfigDelete

func DacFwconfigDelete(id int, logupn string) (err error)

func DacFwconfigSave

func DacFwconfigSave(logupn string, dest *Fwconfig) (err error)

func DacGetKey

func DacGetKey(key string) (string, error)

func DacGroupDelete

func DacGroupDelete(id int, logupn string) (err error)

func DacGroupSave

func DacGroupSave(logupn string, dest *Group) (err error)

func DacGroupSaveFromImport

func DacGroupSaveFromImport(name string, fullName string, id string) error

func DacImportUser

func DacImportUser(upn string, name string, isadmin bool, origin string, groups []Group) error

func DacInviteUser

func DacInviteUser(upn string, templateId int, dest *Entity, orig *Entity) (err error)

func DacSaveKey

func DacSaveKey(key string, value string) error

func DacUserAccessDelete

func DacUserAccessDelete(id int, logupn string) (err error)

func DacUserAccessSave

func DacUserAccessSave(logupn string, dest *UserAccess, orig *UserAccess) (err error)

func DacUserAccessTemplateDelete

func DacUserAccessTemplateDelete(id int, logupn string) (err error)

func DacUserAccessTemplateSave

func DacUserAccessTemplateSave(logupn string, dest *UserAccessTemplate) (err error)

func DownloadCRL

func DownloadCRL(db *gorm.DB) ([]string, error)

func DownloadCreateNebulaConfig

func DownloadCreateNebulaConfig(db *gorm.DB, a *Access, isLighthouse bool, port int) (string, error)

func DownloadDNS

func DownloadDNS(db *gorm.DB) ([]string, error)

func DownloadGenereateMyconfig

func DownloadGenereateMyconfig(a *Access) (string, error)

func DownloadGenereateMyconfigUPN

func DownloadGenereateMyconfigUPN(cuser *Entity) (string, error)

func GetLighthouseIP

func GetLighthouseIP(cidrnet string, maxl int, num int) string

func Init

func Init(cfg *utils.Config)

func InitSystemConfig

func InitSystemConfig()

func IpBetween

func IpBetween(from net.IP, to net.IP, test net.IP) bool

func LogStoreDatachange

func LogStoreDatachange(logtype string, upn string, currobj interface{}, oldobj interface{})

func SendInvitationEmail

func SendInvitationEmail(upn string)

func SystemConfigApplyAadSyncConfig

func SystemConfigApplyAadSyncConfig(aadSyncConfig AADSyncConfig) error

func SystemConfigApplyCIDR

func SystemConfigApplyCIDR(cidr string) error

func SystemConfigApplyCliApiConfig

func SystemConfigApplyCliApiConfig(enableApi bool) error

func SystemConfigMigrateCIDR

func SystemConfigMigrateCIDR(tx *gorm.DB) error

func TestInit

func TestInit(cfg *utils.Config)

Types

type AADSyncConfig

type AADSyncConfig struct {
	Enabled         bool
	AADTenantID     string
	AADClientID     string
	AADClientSecret string
	AdminGroupID    string
}

type Access

type Access struct {
	Base
	Name                     string `gorm:"type:varchar(256);not null"`
	IpAddress                string `gorm:"type:varchar(32);index;unique;not null"`
	FQDN                     string `gorm:"type:varchar(256);not null"`
	AdditionalHostnames      string `gorm:"type:TEXT NOT NULL DEFAULT ''"`
	Description              string
	AccessGroups             []AccessGroup `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	FwconfigID               int           `gorm:"not null"`
	Fwconfig                 Fwconfig
	EntityID                 int `gorm:"index;not null"`
	ValidFrom                time.Time
	ValidTo                  time.Time
	Certificate              Certificate      `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" json:",omitempty"`
	Secret                   string           `gorm:"type:varchar(256);null" json:"-"`
	Changed                  time.Time        `gorm:"type:TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"`
	AccessListeners          []AccessListener `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	NebulaPunchBack          *bool            `gorm:"default:false;not null"`
	NebulaRestrictiveNetwork *bool            `gorm:"default:false;not null"`
	Autoupdate               *bool            `gorm:"default:false;not null"`
	AccessStatistic          AccessStatistic  `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:",omitempty"`
	AccessDevice             AccessDevice     `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:",omitempty"`
	UserAccessID             int              `gorm:"index;null"`
	OSAutoupdateConfig       string
}

func DacAccessCreateForUser

func DacAccessCreateForUser(logupn string, user_access_id int, client_id string, device_name string, device_os string, client_version string, publickey string) (access Access, certificate string, err error)

func DacAccessGet

func DacAccessGet(id int) (dest Access, err error)

func (*Access) AfterFind

func (a *Access) AfterFind(tx *gorm.DB) (err error)

func (*Access) BeforeSave

func (a *Access) BeforeSave(tx *gorm.DB) (err error)

type AccessDevice

type AccessDevice struct {
	AccessID      int       `gorm:"primaryKey;not null"`
	DeviceName    string    `gorm:"type:varchar(256);not null"`
	DeviceID      string    `gorm:"type:varchar(64);not null;index"`
	DeviceOs      string    `gorm:"type:varchar(256);not null"`
	ClientVersion string    `gorm:"type:varchar(256)"`
	Contacted     time.Time `gorm:"type:TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"`
	OSAutoUpdate  string
}

type AccessGroup

type AccessGroup struct {
	Base     `json:"-"`
	AccessID int `gorm:"index;not null" json:"-"`
	GroupID  int `gorm:"index;not null" json:"-"`
	Group    Group
}

type AccessListener

type AccessListener struct {
	Base                 `json:"-"`
	AccessID             int `gorm:"index;not null" json:"-"`
	ListenPort           int
	Protocol             string
	ForwardPort          int
	ForwardHost          string
	AccessListenerTypeID int `gorm:"not null;default:1"`
	AccessListenerType   AccessListenerType
	Description          string
}

type AccessListenerType

type AccessListenerType struct {
	Base
	Glyph string `gorm:"type:varchar(64);not null"`
	Name  string `gorm:"type:varchar(256);not null"`
}

func DacAccessListenerTypeList

func DacAccessListenerTypeList(filter string) (dest []AccessListenerType, err error)

type AccessStatistic

type AccessStatistic struct {
	AccessID                 int       `gorm:"primaryKey;not null"`
	IsConnected              *bool     `gorm:"default:false;not null"`
	NebulaRestrictiveNetwork *bool     `gorm:"default:false;not null"`
	Contacted                time.Time `gorm:"type:TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"`
}

type AccessStatisticData

type AccessStatisticData struct {
	ID          string `gorm:"type:varchar(256);primaryKey;not null"`
	HourPeriod  string `gorm:"type:varchar(16);index;not null"`
	UPN         string `gorm:"type:varchar(256);index;not null"`
	AccessID    int    `gorm:"not null"`
	IsConnected *bool  `gorm:"default:false;not null"`
	IsContacted *bool  `gorm:"default:false;not null"`
	DataIn      int64  `gorm:"default:0;not null"`
	DataOut     int64  `gorm:"default:0;not null"`
	IsUser      *bool  `gorm:"default:false;not null"`
}

type Base

type Base struct {
	ID int `gorm:"autoIncrement;primaryKey"`
}

type Certificate

type Certificate struct {
	Base
	AccessID        int `gorm:"index;null"`
	SecretCrt       string
	SecretKey       string
	SecretPublicKey string
	Metadata        string
	Fingerprint     string `gorm:"type:varchar(256);not null"`
	ValidFrom       time.Time
	ValidTo         time.Time
}

func CreateCert

func CreateCert(db *gorm.DB, acc *Access, certname string, subnets []string, publickey string) (Certificate, error)

func CreateCertAccess

func CreateCertAccess(db *gorm.DB, acc *Access, publickey string) (Certificate, error)

type CliApiConfig

type CliApiConfig struct {
	Enabled bool
	ApiKey  string
}

type CodeListItem

type CodeListItem struct {
	// Numeric ID
	ID int `json:"id"`
	// Name of the record
	Name string `json:"name"`
}

Code list item.

func DacCodeListFirewalls

func DacCodeListFirewalls() (dest []CodeListItem, err error)

func DacCodeListGroups

func DacCodeListGroups() (dest []CodeListItem, err error)

func DacCodeListUserAccessTemplates

func DacCodeListUserAccessTemplates() (dest []CodeListItem, err error)

type Config

type Config struct {
	Key  string `gorm:"type:varchar(32);primaryKey;not null"`
	Data string
}

func (*Config) AfterFind

func (c *Config) AfterFind(tx *gorm.DB) (err error)

func (*Config) BeforeSave

func (c *Config) BeforeSave(tx *gorm.DB) (err error)

type CostMonthTotalItem

type CostMonthTotalItem struct {
	// year+month
	YearMonth string
	// cost
	Cost float64
	// users and servers
	UsageItems []CostUsageItem
}

month usage total statistics

func DacGetCostUsage

func DacGetCostUsage() (costMonthTotal []CostMonthTotalItem, err error)

type CostUsageItem

type CostUsageItem struct {
	// year+month
	YearMonth string
	// upn
	Upn string
	// is user
	IsUser bool
	// hours
	HoursUsed int
	// cost
	Cost float64
}

cost usage statistics

type DBVersion

type DBVersion struct {
	Version string `gorm:"index;unique;not null"`
}

type DeviceLogin

type DeviceLogin struct {
	Id         string `gorm:"type:varchar(64);index:,unique;not null"`
	UPN        string `gorm:"type:varchar(256);not null"`
	AccessData string
	Created    time.Time `gorm:"type:TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"`
}

type Entity

type Entity struct {
	Base
	EntityType   int    `gorm:"type:int8 NOT NULL DEFAULT 0"`
	UPN          string `gorm:"type:varchar(256);index:,unique,expression:lower(upn);unique;not null"`
	Name         string `gorm:"type:varchar(256);index;not null"`
	Origin       string
	Roles        string
	Description  string
	Secret       string `` /* 138-byte string literal not displayed */
	Accesses     []Access
	UserAccesses []UserAccess
}

func DacAllServers

func DacAllServers() (dest []Entity, err error)

func DacEntityAccesses

func DacEntityAccesses(id int) (dest Entity, err error)

func DacEntityGet

func DacEntityGet(id int) (dest Entity, err error)

func DacEntityList

func DacEntityList(entitytype int, filter string, origin string, preloadAccess bool, preloadUserAccess bool) (dest []Entity, err error)

func DacEntityMe

func DacEntityMe(upn string) (dest Entity, err error)

func DacServerGetAll

func DacServerGetAll(name string) (dest []Entity, err error)

func DacUserByUpn

func DacUserByUpn(upn string) (ret *Entity, err error)

func DacUsersAll

func DacUsersAll() (users []Entity, err error)

func (*Entity) AfterFind

func (e *Entity) AfterFind(tx *gorm.DB) (err error)

func (*Entity) BeforeSave

func (e *Entity) BeforeSave(tx *gorm.DB) (err error)

type Fwconfig

type Fwconfig struct {
	Base
	Name         string        `gorm:"type:varchar(256);index:,unique,expression:lower(name);unique;not null"`
	Fwconfigouts []Fwconfigout `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Fwconfigins  []Fwconfigin  `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Changed      time.Time     `gorm:"type:TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"`
}

func DacFwconfigGet

func DacFwconfigGet(id int) (dest Fwconfig, err error)

func DacFwconfigGetAll

func DacFwconfigGetAll(name string) (dest []Fwconfig, err error)

func DacFwconfigList

func DacFwconfigList(filter string) (dest []Fwconfig, err error)

type Fwconfigin

type Fwconfigin struct {
	Base           `json:"-"`
	FwconfigID     int               `gorm:"index;not null" json:"-"`
	Port           string            `gorm:"type:varchar(32);not null"`
	Proto          string            `gorm:"type:varchar(32);not null"`
	Host           string            `gorm:"type:varchar(256);not null"`
	FwconfigGroups []FwconfiginGroup `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type FwconfiginGroup

type FwconfiginGroup struct {
	Base         `json:"-"`
	FwconfiginID int `gorm:"index;not null" json:"-"`
	GroupID      int `gorm:"not null" json:"-"`
	Group        Group
}

type Fwconfigout

type Fwconfigout struct {
	Base           `json:"-"`
	FwconfigID     int                `gorm:"index;not null" json:"-"`
	Port           string             `gorm:"type:varchar(32);not null"`
	Proto          string             `gorm:"type:varchar(32);not null"`
	Host           string             `gorm:"type:varchar(256);not null"`
	FwconfigGroups []FwconfigoutGroup `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type FwconfigoutGroup

type FwconfigoutGroup struct {
	Base          `json:"-"`
	FwconfigoutID int `gorm:"index;not null" json:"-"`
	GroupID       int `gorm:"not null" json:"-"`
	Group         Group
}

type Group

type Group struct {
	Base
	Name        string `gorm:"type:varchar(256);index:,unique,expression:lower(name);unique;not null;check:name ~ '^[a-zA-Z0-9_.-]*$'"`
	Description string
	ObjectId    string `gorm:"type:varchar(64);index;null"`
}

func DacGroupGet

func DacGroupGet(id int) (dest Group, err error)

func DacGroupGetAll

func DacGroupGetAll(name string) (dest []Group, err error)

func DacGroupList

func DacGroupList(filter string) (dest []Group, err error)

func DacGroupsInFW

func DacGroupsInFW() (dest []Group, err error)

type Ipam

type Ipam struct {
	Base
	IPNumber int    `gorm:"index;unique;not null"`
	IP       string `gorm:"index;unique;not null"`
}

func AcquireIP

func AcquireIP(db *gorm.DB, acc *Access, ip net.IP, withLock bool) (Ipam, error)

AcquireIP new ip for specific config

type IpamError

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

func (*IpamError) Error

func (ipame *IpamError) Error() string

type IpamNamedArgument

type IpamNamedArgument struct {
	Till  int
	Start int
}

type KeyValueStore

type KeyValueStore struct {
	ID      string `gorm:"primaryKey;type:varchar(64);not null"`
	Data    string
	Changed time.Time `gorm:"type:TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"`
}

type LighthouseConfig

type LighthouseConfig struct {
	PublicIP string
	Port     int
	Access   Access
	Hash     string
}

type NebulaClientUPNYamlConfig

type NebulaClientUPNYamlConfig struct {
	Upn    string `yaml:"upn"`
	Uri    string `yaml:"uri"`
	Secret string `yaml:"secret"`
}

type NebulaClientYamlConfig

type NebulaClientYamlConfig struct {
	AccessId int    `yaml:"accessid"`
	PublicIP string `yaml:"publicip"`
	Uri      string `yaml:"uri"`
	Secret   string `yaml:"secret"`
}

type NebulaYamlConfig

type NebulaYamlConfig struct {
	Pki struct {
		Ca        string   `yaml:"ca"`
		Cert      string   `yaml:"cert"`
		Key       string   `yaml:"key"`
		Blocklist []string `yaml:"blocklist"`
	} `yaml:"pki"`
	StaticHostMap map[string][]string `yaml:"static_host_map"`
	Lighthouse    struct {
		AmLighthouse bool     `yaml:"am_lighthouse"`
		Interval     int      `yaml:"interval"`
		Hosts        []string `yaml:"hosts"`
	} `yaml:"lighthouse"`
	Listen struct {
		Host string `yaml:"host"`
		Port int    `yaml:"port"`
	} `yaml:"listen"`
	Punchy struct {
		Punch   bool `yaml:"punch"`
		Respond bool `yaml:"respond"`
	} `yaml:"punchy"`
	Relay struct {
		Relays    []string `yaml:"relays"`
		AmRelay   bool     `yaml:"am_relay"`
		UseRelays bool     `yaml:"use_relays"`
	} `yaml:"relay"`
	Tun struct {
		Disabled           bool        `yaml:"disabled"`
		Dev                string      `yaml:"dev"`
		DropLocalBroadcast bool        `yaml:"drop_local_broadcast"`
		DropMulticast      bool        `yaml:"drop_multicast"`
		TxQueue            int         `yaml:"tx_queue"`
		Mtu                int         `yaml:"mtu"`
		Routes             interface{} `yaml:"routes"`
		UnsafeRoutes       interface{} `yaml:"unsafe_routes"`
	} `yaml:"tun"`
	Logging struct {
		Level  string `yaml:"level"`
		Format string `yaml:"format"`
	} `yaml:"logging"`
	Firewall struct {
		Conntrack struct {
			TCPTimeout     string `yaml:"tcp_timeout"`
			UDPTimeout     string `yaml:"udp_timeout"`
			DefaultTimeout string `yaml:"default_timeout"`
			MaxConnections int    `yaml:"max_connections"`
		} `yaml:"conntrack"`
		Outbound []NebulaYamlConfigFW `yaml:"outbound"`
		Inbound  []NebulaYamlConfigFW `yaml:"inbound"`
	} `yaml:"firewall"`
}

type NebulaYamlConfigFW

type NebulaYamlConfigFW struct {
	Port   string   `yaml:"port"`
	Proto  string   `yaml:"proto"`
	Host   string   `yaml:"host,omitempty"`
	Groups []string `yaml:"groups,omitempty"`
}

type OSAutoUpdateType

type OSAutoUpdateType struct {
	Type                 string    `json:"type"`
	Name                 string    `json:"name"`
	Version              string    `json:"version"`
	Description          string    `json:"description"`
	LastUpdate           time.Time `json:"last_update"`
	LastUpdateOutput     string    `json:"last_update_output"`
	Success              bool      `json:"success"`
	SecurityUpdatesCount int       `json:"security_updates_count"`
	OtherUpdatesCount    int       `json:"other_updates_count"`
	SecurityUpdates      []string  `json:"security_updates"`
	OtherUpdates         []string  `json:"other_updates"`
}

type OSAutoupdateConfigType

type OSAutoupdateConfigType struct {
	Enabled                   bool `json:"enabled"`
	SecurityAutoupdateEnabled bool `json:"securityAutoupdateEnabled"`
	AllAutoupdateEnabled      bool `json:"allAutoupdateEnabled"`
	RestartAfterUpdate        bool `json:"restartAfterUpdate"`
	// 0 means any hour in day
	UpdateHour int `json:"updateHour"`
}

type StatUsersInHour

type StatUsersInHour struct {
	Date  string
	Users int
}

func DacAdminDashboardStatsUsersInHours

func DacAdminDashboardStatsUsersInHours() (userstats []StatUsersInHour, err error)

type SystemConfigDef

type SystemConfigDef struct {
	CA struct {
		Crt     string
		ValidTo time.Time
	}
	Network struct {
		CIDR           string
		MaxLighthouses int
	}
	Lighthouses   []LighthouseConfig
	Secret        string
	AADSyncConfig AADSyncConfig
	CliApiConfig  CliApiConfig
}

func SystemConfig

func SystemConfig() *SystemConfigDef

func (SystemConfigDef) GetCIDR

func (m SystemConfigDef) GetCIDR() string

func (SystemConfigDef) GetCIDRMask

func (m SystemConfigDef) GetCIDRMask() string

func (SystemConfigDef) GetMaxLighthouses

func (m SystemConfigDef) GetMaxLighthouses() int

func (SystemConfigDef) Save

func (c SystemConfigDef) Save(tx *gorm.DB, gencerts bool) error

type UserAccess

type UserAccess struct {
	Base
	Name                 string `gorm:"type:varchar(256);not null"`
	Description          string
	UserAccessTemplateID int `gorm:"not null"`
	UserAccessTemplate   UserAccessTemplate
	UserAccessGroups     []UserAccessGroup `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	FwconfigID           int               `gorm:"not null"`
	Fwconfig             Fwconfig
	EntityID             int `gorm:"index;not null"`
	ValidFrom            time.Time
	ValidTo              time.Time
	Secret               string    `gorm:"type:varchar(256);null" json:"-"`
	Changed              time.Time `gorm:"type:TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"`
	Accesses             []Access  `gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
}

func DacUserAccessGet

func DacUserAccessGet(id int) (dest UserAccess, err error)

func (*UserAccess) AfterFind

func (u *UserAccess) AfterFind(tx *gorm.DB) (err error)

func (*UserAccess) BeforeSave

func (u *UserAccess) BeforeSave(tx *gorm.DB) (err error)

type UserAccessGroup

type UserAccessGroup struct {
	Base         `json:"-"`
	UserAccessID int `gorm:"index;not null" json:"-"`
	GroupID      int `gorm:"index;not null" json:"-"`
	Group        Group
}

type UserAccessTemplate

type UserAccessTemplate struct {
	Base
	Name                     string `gorm:"type:varchar(256);not null"`
	Description              string
	UserAccessTemplateGroups []UserAccessTemplateGroup `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	FwconfigID               int                       `gorm:"not null"`
	Fwconfig                 Fwconfig
	ValidFrom                time.Time
	ValidTo                  time.Time
	Changed                  time.Time    `gorm:"type:TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP"`
	UserAccesses             []UserAccess `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Deleted                  *bool        `gorm:"default:false;not null"`
}

func DacUserAccessTemplateGet

func DacUserAccessTemplateGet(id int) (dest UserAccessTemplate, err error)

func DacUserAccessTemplateList

func DacUserAccessTemplateList(filter string) (dest []UserAccessTemplate, err error)

type UserAccessTemplateGroup

type UserAccessTemplateGroup struct {
	Base                 `json:"-"`
	UserAccessTemplateID int `gorm:"index;not null" json:"-"`
	GroupID              int `gorm:"index;not null" json:"-"`
	Group                Group
}

Jump to

Keyboard shortcuts

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