models

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

type Middleware struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Type      string    `json:"type"`
	Config    string    `json:"config"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Middleware represents a Traefik middleware configuration

func (*Middleware) ConfigMap

func (m *Middleware) ConfigMap() (map[string]interface{}, error)

ConfigMap returns the middleware config as a map

type PangolinResource

type PangolinResource struct {
	ID     string `json:"id"`
	Host   string `json:"host"`
	OrgID  string `json:"org_id"`
	SiteID string `json:"site_id"`
}

PangolinResource represents the format of a resource from Pangolin API

type PangolinRouter

type PangolinRouter struct {
	Rule        string   `json:"rule"`
	Service     string   `json:"service"`
	EntryPoints []string `json:"entryPoints"`
	Middlewares []string `json:"middlewares"`
	TLS         struct {
		CertResolver string `json:"certResolver"`
	} `json:"tls"`
}

PangolinRouter represents a router configuration from Pangolin API

type PangolinService

type PangolinService struct {
	LoadBalancer struct {
		Servers []struct {
			URL string `json:"url"`
		} `json:"servers"`
	} `json:"loadBalancer"`
}

PangolinService represents a service configuration from Pangolin API

type PangolinTraefikConfig

type PangolinTraefikConfig struct {
	HTTP struct {
		Routers  map[string]PangolinRouter  `json:"routers"`
		Services map[string]PangolinService `json:"services"`
	} `json:"http"`
}

PangolinTraefikConfig represents the Traefik configuration from Pangolin API

type Resource

type Resource struct {
	ID        string    `json:"id"`
	Host      string    `json:"host"`
	ServiceID string    `json:"service_id"`
	OrgID     string    `json:"org_id"`
	SiteID    string    `json:"site_id"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	// Middlewares is a list of associated middlewares, populated when needed
	Middlewares []ResourceMiddleware `json:"middlewares,omitempty"`
}

Resource represents a Pangolin resource

type ResourceMiddleware

type ResourceMiddleware struct {
	ResourceID   string    `json:"resource_id"`
	MiddlewareID string    `json:"middleware_id"`
	Priority     int       `json:"priority"`
	CreatedAt    time.Time `json:"created_at"`
}

ResourceMiddleware represents the relationship between a resource and a middleware

Jump to

Keyboard shortcuts

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