models

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	ID        uint      `json:"-" gorm:"primaryKey;unique;autoIncrement"`
	Name      string    `json:"name" gorm:"index:idx_name,unique" example:"gmail.com"`
	Type      string    `json:"type" example:"whitelist"`
	Coverage  string    `json:"coverage" example:"equals"`
	CreatedAt time.Time `json:"-"`
	UpdatedAt time.Time `json:"-"`
}

func (*Domain) Match added in v1.0.3

func (d *Domain) Match(domainName string) bool

type DomainRepository

type DomainRepository interface {
	FindAll() (*[]Domain, error)
	FindByID(id int) (*Domain, error)
	FindByName(name string) (*Domain, error)
	Create(domain *Domain) error
	Update(domain *Domain) error
	Delete(domain *Domain) error
	MatchEquals(name string) (*Domain, error)
	MatchContains(name string) (*Domain, error)
	MatchBegins(name string) (*Domain, error)
	MatchEnds(name string) (*Domain, error)
}

type RootDomain

type RootDomain struct {
	ID        uint      `json:"id" gorm:"primaryKey;unique;autoIncrement"`
	Name      string    `json:"name" gorm:"index:idx_name,unique"`
	Type      string    `json:"type"`
	TLD       string    `json:"tld"`
	Source    string    `json:"source"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

type RootDomainRepository

type RootDomainRepository interface {
	FindByID(id int) (*RootDomain, error)
	FindByName(name string) (*RootDomain, error)
	Create(rootDomain *RootDomain) error
	Update(rootDomain *RootDomain) error
	Delete(rootDomain *RootDomain) error
}

Jump to

Keyboard shortcuts

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