http

package
v0.0.0-...-464045c Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username string, password string) gin.HandlerFunc

func ValidateRecordValue

func ValidateRecordValue(recordType management.RecordType, value json.RawMessage) error

Types

type AAAARecord

type AAAARecord []struct {
	IP net.IP `json:"ip"`
}

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(service *management.ManagementService) *API

func (*API) CreateRecord

func (a *API) CreateRecord(c *gin.Context)

func (*API) CreateZone

func (a *API) CreateZone(c *gin.Context)

func (*API) DeleteRecord

func (a *API) DeleteRecord(c *gin.Context)

func (*API) DeleteZone

func (a *API) DeleteZone(c *gin.Context)

func (*API) Record

func (a *API) Record(c *gin.Context)

func (*API) Records

func (a *API) Records(c *gin.Context)

func (*API) UpdateRecord

func (a *API) UpdateRecord(c *gin.Context)

func (*API) Zone

func (a *API) Zone(c *gin.Context)

func (*API) Zones

func (a *API) Zones(c *gin.Context)

type ARecord

type ARecord []struct {
	IP net.IP `json:"ip"`
}

type CNAMERecord

type CNAMERecord struct {
	Target string `json:"target"`
}

type CreateRecordRequestBody

type CreateRecordRequestBody struct {
	Name  string                `json:"name" binding:"required" validate:"ascii,min=1,max=255"`
	Type  management.RecordType `json:"type" binding:"required"`
	TTL   uint32                `json:"ttl" binding:"required"`
	Value json.RawMessage       `json:"value" binding:"required"`
}

type CreateRecordRequestURI

type CreateRecordRequestURI struct {
	ZoneID string `uri:"zone_id" binding:"required" validate:"uuid4"`
}

type CreateRecordResponse

type CreateRecordResponse struct {
	Error  string             `json:"error,omitempty"`
	Record *management.Record `json:"record,omitempty"`
}

type CreateZoneRequest

type CreateZoneRequest struct {
	Zone string `json:"zone" binding:"required" validate:"hostname"`
}

type CreateZoneResponse

type CreateZoneResponse struct {
	Error string           `json:"error,omitempty"`
	Zone  *management.Zone `json:"zone,omitempty"`
}

type DeleteRecordRequest

type DeleteRecordRequest struct {
	ZoneID   string `uri:"zone_id" binding:"required" validate:"uuid4"`
	RecordID string `uri:"record_id" binding:"required" validate:"uuid4"`
}

type DeleteRecordResponse

type DeleteRecordResponse struct {
	Error string `json:"error"`
}

type DeleteZoneRequest

type DeleteZoneRequest struct {
	ZoneID string `uri:"zone_id" binding:"required" validate:"uuid4"`
}

type DeleteZoneResponse

type DeleteZoneResponse struct {
	Error string `json:"error,omitempty"`
}

type HTTP

type HTTP struct {
	// contains filtered or unexported fields
}

func NewHTTPServer

func NewHTTPServer(api *API, engine *gin.Engine, addr string, authMiddleware gin.HandlerFunc) *HTTP

func (*HTTP) RegisterRoutes

func (h *HTTP) RegisterRoutes()

func (*HTTP) Run

func (h *HTTP) Run() error

type MXRecord

type MXRecord []struct {
	Preference int    `json:"preference"`
	Domain     string `json:"domain"`
}

type NSRecord

type NSRecord []struct {
	Domain string `json:"domain"`
}

type PTRRecord

type PTRRecord struct {
	Domain string `json:"domain"`
}

type RecordRequest

type RecordRequest struct {
	ZoneID   string `uri:"zone_id" binding:"required" validate:"uuid4"`
	RecordID string `uri:"record_id" binding:"required" validate:"uuid4"`
}

type RecordResponse

type RecordResponse struct {
	Error  string             `json:"error,omitempty"`
	Record *management.Record `json:"record,omitempty"`
}

type RecordsRequest

type RecordsRequest struct {
	ZoneID string `uri:"zone_id" binding:"required" validate:"uuid4"`
}

type RecordsResponse

type RecordsResponse struct {
	Error   string              `json:"error,omitempty"`
	Records []management.Record `json:"records,omitempty"`
}

type TXTRecord

type TXTRecord []struct {
	Text string `json:"text"`
}

type UpdateRecordRequestBody

type UpdateRecordRequestBody struct {
	Name  string                `json:"name" binding:"required" validate:"ascii,min=1,max=255"`
	Type  management.RecordType `json:"type" binding:"required"`
	TTL   uint32                `json:"ttl" binding:"required"`
	Value json.RawMessage       `json:"value" binding:"required"`
}

type UpdateRecordRequestURI

type UpdateRecordRequestURI struct {
	ZoneID   string `uri:"zone_id" binding:"required" validate:"uuid4"`
	RecordID string `uri:"record_id" binding:"required" validate:"uuid4"`
}

type UpdateRecordResponse

type UpdateRecordResponse struct {
	Error  string             `json:"error,omitempty"`
	Record *management.Record `json:"record,omitempty"`
}

type ZoneRequest

type ZoneRequest struct {
	ZoneID string `uri:"zone_id" binding:"required" validate:"uuid4"`
}

type ZoneResponse

type ZoneResponse struct {
	Error string           `json:"error,omitempty"`
	Zone  *management.Zone `json:"zone,omitempty"`
}

type ZonesResponse

type ZonesResponse struct {
	Error string            `json:"error,omitempty"`
	Zones []management.Zone `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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