model

package
v0.0.0-...-1a88b7f Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DomainTypeUndefined uint = iota
	DomainTypeIpa

	DomainTypeIpaString       = "rhel-idm"
	DomainTypeUndefinedString = ""
)

Variables

View Source
var (
	NilUUID = uuid.MustParse("00000000-0000-0000-0000-000000000000")
)

Functions

func DomainTypeString

func DomainTypeString(data uint) string

func DomainTypeUint

func DomainTypeUint(data string) uint

Types

type Domain

type Domain struct {
	gorm.Model
	OrgId                 string    `gorm:"index:idx_domains_org_id"`
	DomainUuid            uuid.UUID `gorm:"unique"`
	DomainName            *string
	Title                 *string
	Description           *string
	Type                  *uint
	AutoEnrollmentEnabled *bool
	IpaDomain             *Ipa `gorm:"foreignKey:ID"`
}

func (*Domain) AfterCreate

func (d *Domain) AfterCreate(tx *gorm.DB) (err error)

See: https://gorm.io/docs/hooks.html

func (*Domain) FillAndPreload

func (d *Domain) FillAndPreload(db *gorm.DB) (err error)

FillAndPreload is a helper method to fill and preload a domain object based TODO: use "AfterFind" hook instead?

type Ipa

type Ipa struct {
	gorm.Model
	CaCerts      []IpaCert
	Servers      []IpaServer
	Locations    []IpaLocation
	RealmName    *string
	RealmDomains pq.StringArray `gorm:"type:text[]"`

	Domain Domain `gorm:"foreignKey:ID;references:ID"`
}

Ipa represent the specific rhel-idm domain information

func (*Ipa) AfterCreate

func (i *Ipa) AfterCreate(tx *gorm.DB) (err error)

type IpaCert

type IpaCert struct {
	gorm.Model
	IpaID        uint
	Issuer       string
	Nickname     string
	NotAfter     time.Time
	NotBefore    time.Time
	Pem          string
	SerialNumber string
	Subject      string
}

type IpaLocation

type IpaLocation struct {
	gorm.Model
	IpaID       uint
	Name        string
	Description *string
}

IpaLocation represent the possible locations for a rhel-idm instance.

type IpaServer

type IpaServer struct {
	gorm.Model
	IpaID               uint
	FQDN                string
	RHSMId              *string `gorm:"unique;column:rhsm_id"`
	Location            *string
	CaServer            bool
	HCCEnrollmentServer bool
	HCCUpdateServer     bool
	PKInitServer        bool
}

Jump to

Keyboard shortcuts

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