ui

package
v2.15.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRouteSorter

func DefaultRouteSorter() *routeSorter

Types

type BalancingPolicy

type BalancingPolicy struct {
	Id                   int32                 `json:"id"`
	Header               *Header               `json:"header,omitempty"`
	Cookie               *Cookie               `json:"cookie,omitempty"`
	ConnectionProperties *ConnectionProperties `json:"connectionProperties,omitempty"`
	QueryParameter       *QueryParameter       `json:"queryParameter,omitempty"`
	Terminal             domain.NullBool       `json:"terminal,omitempty" swaggertype:"boolean"`
}

type CertificateDetails

type CertificateDetails struct {
	CertificateCommonName       string    `json:"certificateCommonName,omitempty"`
	CertificateId               string    `json:"certificateId,omitempty"`
	Valid                       bool      `json:"valid" swaggertype:"boolean"`
	ValidFrom                   time.Time `json:"validFrom"`
	ValidTill                   time.Time `json:"validTill"`
	DaysTillExpiry              int       `json:"daysTillExpiry" swaggertype:"integer"`
	SANs                        []string  `json:"sans,omitempty"`
	IssuerCertificateCommonName string    `json:"issuerCertificateCommonName,omitempty"`
	IssuerCertificateId         string    `json:"issuerCertificateId,omitempty"`
	Reason                      string    `json:"reason,omitempty"`
}

type CertificateDetailsResponse

type CertificateDetailsResponse struct {
	TlsDefDetails []*TlsDefDetails `json:"details"`
}

type CertificateUsedIn

type CertificateUsedIn struct {
	Clusters []*CertificateUsedInCluster `json:"clusters,omitempty"`
	Gateway  string                      `json:"gateway,omitempty"`
}

type CertificateUsedInCluster

type CertificateUsedInCluster struct {
	Name      string   `json:"name,omitempty"`
	Endpoints []string `json:"endpoints,omitempty"`
}

type Cluster

type Cluster struct {
	Id                 int32                   `json:"id"`
	Name               string                  `json:"name"`
	EnableH2           bool                    `json:"enableH2"`
	NodeGroups         []NodeGroup             `json:"nodeGroups"`
	DeploymentVersions []DeploymentVersionsExt `json:"deploymentVersions"`
}

type ConnectionProperties

type ConnectionProperties struct {
	SourceIp domain.NullBool `json:"sourceIp" yaml:"sourceIp" swaggertype:"boolean"`
}
type Cookie struct {
	Name string            `json:"name" yaml:"name"`
	Ttl  *int64            `json:"ttl" yaml:"ttl"`
	Path domain.NullString `json:"path" yaml:"path" swaggertype:"string"`
}

type DataStorage

type DataStorage interface {
	FindAllRouteConfigs() ([]*domain.RouteConfiguration, error)
	FindVirtualHostsByRouteConfigurationId(configId int32) ([]*domain.VirtualHost, error)
	FindAllDeploymentVersions() ([]*domain.DeploymentVersion, error)
	FindRoutesByVirtualHostIdAndDeploymentVersion(vhId int32, version string) ([]*domain.Route, error)
	FindRouteByUuid(uuid string) (*domain.Route, error)
	FindVirtualHostById(vhId int32) (*domain.VirtualHost, error)
	FindDeploymentVersion(version string) (*domain.DeploymentVersion, error)
	FindRouteConfigById(routeConfigurationId int32) (*domain.RouteConfiguration, error)
	FindClusterByName(key string) (*domain.Cluster, error)
	FindEndpointsByClusterIdAndDeploymentVersion(clusterId int32, dVersions *domain.DeploymentVersion) ([]*domain.Endpoint, error)
	FindHeaderMatcherByRouteId(routeId int32) ([]*domain.HeaderMatcher, error)
}

type DeploymentVersion

type DeploymentVersion struct {
	Name  string `json:"name"`
	Stage string `json:"stage"`
}

type DeploymentVersionsExt

type DeploymentVersionsExt struct {
	Name              string            `json:"name"`
	Stage             string            `json:"stage"`
	Endpoint          Endpoint          `json:"endpoint"`
	BalancingPolicies []BalancingPolicy `json:"balancingPolicies"`
}

type Endpoint

type Endpoint struct {
	Id      int32  `json:"id"`
	Address string `json:"address"`
	Port    int32  `json:"port"`
}
type Header struct {
	HeaderName string `json:"headerName" yaml:"headerName"`
}

type HeaderMatcher

type HeaderMatcher struct {
	Name           string          `json:"name"`
	ExactMatch     string          `json:"exactMatch"`
	SafeRegexMatch string          `json:"safeRegexMatch"`
	RangeMatch     RangeMatch      `json:"rangeMatch"`
	PresentMatch   domain.NullBool `json:"presentMatch" swaggertype:"boolean"`
	PrefixMatch    string          `json:"prefixMatch"`
	SuffixMatch    string          `json:"suffixMatch"`
	InvertMatch    bool            `json:"invertMatch"`
}

type HeaderToAdd

type HeaderToAdd struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type NodeGroup

type NodeGroup struct {
	Name string `json:"name"`
}

type PageRoutes

type PageRoutes struct {
	NodeGroup       string  `json:"nodeGroup"`
	VirtualHostName string  `json:"virtualHostName"`
	VersionName     string  `json:"versionName"`
	VersionStage    string  `json:"versionStage"`
	TotalCount      int     `json:"totalCount"`
	Routes          []Route `json:"routes"`
}

type QueryParameter

type QueryParameter struct {
	Name string `json:"name" yaml:"name"`
}

type RangeMatch

type RangeMatch struct {
	Start domain.NullInt `json:"start" swaggertype:"integer"`
	End   domain.NullInt `json:"end" swaggertype:"integer"`
}

type RelationsService

type RelationsService interface {
	GetClustersWithRelations() ([]*domain.Cluster, error)
}

type Route

type Route struct {
	Uuid         string `json:"uuid"`
	Match        string `json:"match"`
	MatchRewrite string `json:"matchRewrite"`
	ClusterName  string `json:"clusterName"`
	Allowed      bool   `json:"allowed"`
}

type RouteDetails

type RouteDetails struct {
	Path                   string          `json:"path"`
	PathRewrite            string          `json:"pathRewrite"`
	Prefix                 string          `json:"prefix"`
	PrefixRewrite          string          `json:"prefixRewrite"`
	Regexp                 string          `json:"regexp"`
	RegexpRewrite          string          `json:"regexpRewrite"`
	ClusterName            string          `json:"clusterName"`
	HostRewrite            string          `json:"hostRewrite"`
	HostAutoRewrite        *bool           `json:"hostAutoRewrite"`
	DirectResponse         uint32          `json:"directResponse"`
	Endpoint               string          `json:"endpoint"`
	Timeout                *int64          `json:"timeout"`
	IdleTimeout            *int64          `json:"idleTimeout"`
	HeaderMatchers         []HeaderMatcher `json:"headerMatchers"`
	RequestHeadersToAdd    []HeaderToAdd   `json:"requestHeadersToAdd"`
	RequestHeadersToRemove []string        `json:"requestHeadersToRemove"`
}

type RouteSorter

type RouteSorter interface {
	Sort(routes []*domain.Route) []*domain.Route
}

type SearchRoutesParameters

type SearchRoutesParameters struct {
	VirtualHostId int32
	Version       string
	Size          int
	Page          int
	Search        string
}

func ParseGetRoutesParameters

func ParseGetRoutesParameters(ctx context.Context, fiberCtx *fiber.Ctx) (SearchRoutesParameters, error)

func (SearchRoutesParameters) LowerBound

func (p SearchRoutesParameters) LowerBound() int

func (SearchRoutesParameters) UpperBound

func (p SearchRoutesParameters) UpperBound() int

type SimplifiedRouteConfig

type SimplifiedRouteConfig struct {
	NodeGroup    string        `json:"nodeGroup"`
	VirtualHosts []VirtualHost `json:"virtualHosts"`
}

type TlsDefDetails

type TlsDefDetails struct {
	Name         string                `json:"name"`
	UsedIn       []*CertificateUsedIn  `json:"usedIn,omitempty"`
	Endpoints    []string              `json:"endpoints,omitempty"`
	Certificates []*CertificateDetails `json:"certificates,omitempty"`
}

type V3ApiController

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

func NewV3Controller

func NewV3Controller(service V3ApiUIService) *V3ApiController

func (*V3ApiController) HandleGetCloudConfig

func (c *V3ApiController) HandleGetCloudConfig(fiberCtx *fiber.Ctx) error

HandleGetCloudConfig godoc @Id GetCloudConfig @Summary Get Cloud Config @Description Get Cloud Config @Tags control-plane-v3 @Produce json @Security ApiKeyAuth @Success 200 {array} ui.SimplifiedRouteConfig @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/v3/ui/cloud-config [get]

func (*V3ApiController) HandleGetClusters

func (c *V3ApiController) HandleGetClusters(fiberCtx *fiber.Ctx) error

HandleGetClusters godoc @Id GetClustersV3 @Summary Get Clusters V3 @Description Get Clusters V3 @Tags control-plane-v3 @Produce json @Security ApiKeyAuth @Success 200 {array} ui.Cluster @Failure 500 {object} map[string]string @Router /api/v3/ui/clusters [get]

func (*V3ApiController) HandleGetRouteDetails

func (c *V3ApiController) HandleGetRouteDetails(fiberCtx *fiber.Ctx) error

HandleGetRouteDetails godoc @Id GetRouteDetails @Summary Get Route Details @Description Get Route Details @Tags control-plane-v3 @Produce json @Param routeUuid path string true "routeUuid" @Security ApiKeyAuth @Success 200 {object} ui.RouteDetails @Failure 500 {object} map[string]string @Router /api/v3/ui/route/{routeUuid}/details [get]

func (*V3ApiController) HandleGetRoutes

func (c *V3ApiController) HandleGetRoutes(fiberCtx *fiber.Ctx) error

HandleGetRoutes godoc @Id GetRoutes @Summary Get Routes @Description Get Routes @Tags control-plane-v3 @Produce json @Param versionId path string true "versionId" @Param virtualHostId path string true "virtualHostId" @Param page query string false "page" @Param size query string false "size" @Security ApiKeyAuth @Success 200 {object} ui.PageRoutes @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/v3/ui/{virtualHostId}/{versionId}/routes [get]

type V3ApiUIService

type V3ApiUIService interface {
	GetAllSimplifiedRouteConfigs(ctx context.Context) ([]SimplifiedRouteConfig, error)
	GetRoutesPage(ctx context.Context, params SearchRoutesParameters) (PageRoutes, error)
	GetAllClusters(ctx context.Context) ([]Cluster, error)
	GetRouteDetails(ctx context.Context, uuid string) (RouteDetails, error)
}

type V3Service

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

func NewV3Service

func NewV3Service(rep dao.Repository, entityService *entity.Service, sorter RouteSorter) *V3Service

func (*V3Service) GetAllClusters

func (s *V3Service) GetAllClusters(ctx context.Context) ([]Cluster, error)

func (*V3Service) GetAllSimplifiedRouteConfigs

func (s *V3Service) GetAllSimplifiedRouteConfigs(ctx context.Context) ([]SimplifiedRouteConfig, error)

func (*V3Service) GetRouteDetails

func (s *V3Service) GetRouteDetails(ctx context.Context, uuid string) (RouteDetails, error)

func (*V3Service) GetRoutesPage

func (s *V3Service) GetRoutesPage(ctx context.Context, params SearchRoutesParameters) (PageRoutes, error)

type VirtualHost

type VirtualHost struct {
	Id                 int32               `json:"id"`
	Name               string              `json:"name"`
	DeploymentVersions []DeploymentVersion `json:"deploymentVersions"`
}

Jump to

Keyboard shortcuts

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