network

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("Network not found")
)

Functions

This section is empty.

Types

type DBTag

type DBTag struct {
	ID        uint           `json:"-" gorm:"primaryKey" yaml:"-"`
	CreatedAt time.Time      `json:"-" yaml:"-"`
	UpdatedAt time.Time      `json:"-" yaml:"-"`
	DeletedAt gorm.DeletedAt `json:"-" gorm:"index" yaml:"-"`
	SiteID    uint           `json:"-" yaml:"-"`
	Value     string         `json:"value" yaml:"value"`
}

type IHandler added in v1.3.1

type IHandler interface {
	Get() (*Network, error)
	Create(*Network) error
}

func NewHandler added in v1.3.3

func NewHandler(repo repository) IHandler
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 NetworkID

type NetworkID struct {
	ID uint `json:"id" yaml:"-"`
}

type Service added in v1.3.1

type Service struct {
	Handler IHandler
}

func (*Service) Create added in v1.3.1

func (c *Service) Create(ctx echo.Context) error

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]

func (*Service) Get added in v1.3.1

func (c *Service) Get(ctx echo.Context) error

Get godoc @Summary Get Network @Description get network @Tags Network @Accept json @Produce json @Success 200 {object} Network @Failure 404 {object} httperror.HTTPError @Failure 503 {object} httperror.HTTPError @Router /api/network [get]

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:"-"`
}

Jump to

Keyboard shortcuts

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