Documentation
¶
Index ¶
- type Controller
- type Group
- type Host
- type MetaInfo
- type Service
- func (s *Service) AddGroup(group *Group) error
- func (s *Service) AddHost(host *Host) error
- func (s *Service) DeleteGroup(id uuid.UUID) error
- func (s *Service) DeleteHost(id uuid.UUID) error
- func (s *Service) DetailHost(id uuid.UUID) (*Host, error)
- func (s *Service) Initialize() error
- func (s *Service) ListGroup(group *Group) ([]*Group, error)
- func (s *Service) ListHost(host *Host) ([]*Host, error)
- func (s *Service) UpdateGroup(group *Group) error
- func (s *Service) UpdateHost(host *Host) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController() *Controller
func (*Controller) RegisterRoute ¶
func (c *Controller) RegisterRoute(engine *gin.RouterGroup)
type Group ¶
type Group struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey" swaggerignore:"true" example:"00000000-0000-0000-0000-000000000000"` Title string `json:"title" gorm:"unique;not null" validate:"required"` Hosts []*Host `json:"hosts" gorm:"foreignkey:GroupId" swaggerignore:"true"` CreatedAt time.Time `json:"createdAt" swaggerignore:"true"` UpdatedAt time.Time `json:"updatedAt" swaggerignore:"true"` }
type Host ¶
type Host struct { ID uuid.UUID `json:"id" gorm:"type:uuid;primaryKey" swaggerignore:"true" example:"00000000-0000-0000-0000-000000000000"` Title string `json:"title" gorm:"not null" validate:"required"` Desc string `json:"desc"` HostInfo sshutil.HostInfo `json:"hostInfo" gorm:"not null"` MetaInfo MetaInfo `json:"metaInfo" swaggerignore:"true"` Group Group `json:"group" swaggerignore:"true" validate:"omitempty"` GroupId uuid.UUID `json:"groupId"` database.BaseModel }
type MetaInfo ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func GetService ¶
func GetService() *Service
func (*Service) DeleteGroup ¶
DeleteGroup delete host group
func (*Service) DeleteHost ¶
DeleteHost delete host
func (*Service) DetailHost ¶
DetailHost detail host
func (*Service) Initialize ¶
func (*Service) UpdateGroup ¶
UpdateGroup update host group
Click to show internal directories.
Click to hide internal directories.