| 123456789101112131415161718192021222324252627 |
- package models
- import (
- "net"
- "github.com/google/uuid"
- "gorm.io/gorm"
- )
- // Ipam represents an entry in the Ipam table
- type Ipam struct {
- gorm.Model
- // ID is a UUID for the APIContract
- ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
- // ProjectID is the ID of the project that the config belongs to.
- // This should be a foreign key, but GORM doesnt play well with FKs.
- ProjectID int `json:"project_id"`
- CIDR net.IPNet `gorm:"type:cidr;column:cidr_range"`
- }
- // TableName overrides the table name
- func (Ipam) TableName() string {
- return "ipam"
- }
|