Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("Network not found")
)
Functions ¶
This section is empty.
Types ¶
type IHandler ¶ added in v1.3.1
func NewHandler ¶ added in v1.3.3
func NewHandler(repo repository) IHandler
type Link ¶
type Link struct { ID uint `json:"-" gorm:"primaryKey" yaml:"-"` CreatedAt time.Time `json:"-" yaml:"-"` UpdatedAt time.Time `json:"-" yaml:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index" yaml:"-"` NetworkID uint `json:"-" yaml:"-"` Name string `json:"name" yaml:"name"` URI string `json:"uri" yaml:"uri"` }
type Network ¶
type Network struct { ID uint `json:"-" gorm:"primaryKey" yaml:"-"` CreatedAt time.Time `json:"-" yaml:"-"` UpdatedAt time.Time `json:"-" yaml:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index" yaml:"-"` Network string `json:"network" yaml:"network"` Links []Link `json:"links" gorm:"foreignkey:NetworkID" yaml:"links"` Sites []Site `json:"sites" gorm:"foreignkey:NetworkID" yaml:"sites"` }
type Service ¶ added in v1.3.1
type Service struct {
Handler IHandler
}
func (*Service) Create ¶ added in v1.3.1
Create godoc @Summary Add Network @Description add or update network @Tags Network @Accept json @Produce json @Param network body Network true "Add Network" @Success 201 {object} NetworkID @Failure 400 {object} httperror.HTTPError @Failure 500 {object} httperror.HTTPError @Router /api/network [post]
type Site ¶
type Site struct { ID uint `json:"-" gorm:"primaryKey" yaml:"-"` CreatedAt time.Time `json:"-" yaml:"-"` UpdatedAt time.Time `json:"-" yaml:"-"` DeletedAt gorm.DeletedAt `json:"-" gorm:"index" yaml:"-"` NetworkID uint `json:"-" yaml:"-"` Name string `json:"name" yaml:"name"` URI string `json:"uri" yaml:"uri"` Icon string `json:"icon" yaml:"icon"` IsSupportedApp bool `json:"isSupportedApp" yaml:"isSupportedApp"` DBTags []DBTag `json:"-" gorm:"foreignkey:SiteID" yaml:"-"` Tags []string `json:"tags" gorm:"-" yaml:"tags"` IP string `json:"ip" gorm:"-" yaml:"-"` IsUp bool `json:"isUp" gorm:"-" yaml:"-"` }
Click to show internal directories.
Click to hide internal directories.