migration

package
v2.16.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountRows

func CountRows(rows *sql.Rows) int

func Generate

func Generate(routeMatch V132RouteMatch) string

func GenerateKey

func GenerateKey(route V132Route) string

func GetMigrations

func GetMigrations() (*migrate.Migrations, error)

Types

type V16HeaderMatcher

type V16HeaderMatcher struct {
	bun.BaseModel  `bun:"header_matchers"`
	Id             int32          `bun:",pk" json:"id"`
	Name           string         `bun:",notnull" json:"name"`
	Version        int32          `bun:",notnull" json:"version"`
	ExactMatch     string         `bun:"exactmatch" json:"exactMatch"`
	SafeRegexMatch string         `bun:"saferegexmatch" json:"safeRegexMatch"`
	RangeMatch     *V16RangeMatch `bun:"rangematch,type:jsonb" json:"rangeMatch"`
	PresentMatch   *bool          `bun:"presentmatch" json:"presentMatch"`
	PrefixMatch    string         `bun:"prefixmatch" json:"prefixMatch"`
	SuffixMatch    string         `bun:"suffixmatch" json:"suffixMatch"`
	InvertMatch    bool           `bun:"invertmatch,default:false" json:"invertMatch"`
	RouteId        int32          `bun:"routeid,notnull" json:"-"`
	Route          *V16Route      `bun:"rel:belongs-to,join:routeid=id" json:"-" yaml:"-"`
}

type V16RangeMatch

type V16RangeMatch struct {
	Start domain.NullInt `json:"start"`
	End   domain.NullInt `json:"end"`
}

type V16Route

type V16Route struct {
	bun.BaseModel            `bun:"routes"`
	Id                       int32              `bun:",pk" json:"id"`
	Uuid                     string             `bun:"uuid,notnull,type:varchar,unique" json:"uuid"`
	VirtualHostId            int32              `bun:"virtualhostid,notnull" json:"virtualHostId"`
	RouteKey                 string             `bun:"routekey,notnull" json:"routeKey"`
	DirectResponseCode       uint32             `bun:"directresponse_status" json:"directResponseCode"`
	Prefix                   string             `bun:"rm_prefix" json:"prefix"`
	Regexp                   string             `bun:"rm_regexp" json:"regexp"`
	Path                     string             `bun:"rm_path" json:"path"`
	ClusterName              string             `bun:"ra_clustername" json:"clusterName"`
	HostRewrite              string             `bun:"ra_hostrewrite" json:"hostRewrite"`
	HostAutoRewrite          *bool              `bun:"ra_hostautorewrite" json:"hostAutoRewrite"`
	PrefixRewrite            string             `bun:"ra_prefixrewrite" json:"prefixRewrite"`
	RegexpRewrite            string             `bun:"ra_regexprewrite" json:"regexpRewrite"`
	PathRewrite              string             `bun:"ra_pathrewrite" json:"pathRewrite"`
	Version                  int32              `bun:",notnull" json:"version"`
	DeploymentVersion        string             `bun:"deployment_version,notnull" json:"deploymentVersionString"`
	InitialDeploymentVersion string             `bun:"initialdeploymentversion,notnull" json:"initialDeploymentVersion"`
	Autogenerated            bool               `bun:"autogenerated,default:false" json:"autogenerated"`
	HeaderMatchers           []V16HeaderMatcher `bun:"rel:has-many,join:id=routeid" json:"headerMatchers"`
}

type V19Cluster

type V19Cluster struct {
	bun.BaseModel `bun:"table:clusters"`
	Id            int32         `bun:",pk" json:"id"`
	Name          string        `bun:",notnull" json:"name"`
	LbPolicy      string        `bun:"lbpolicy,notnull" json:"lbPolicy"`
	DiscoveryType string        `bun:"column:type,notnull" json:"type"`
	Version       int32         `bun:",notnull"`
	EnableH2      bool          `bun:"enableh2,nullzero,notnull,default:false" json:"enableH2"`
	Endpoints     []V19Endpoint `bun:"rel:has-many,join:id=clusterid"`
}

type V19DeploymentVersion

type V19DeploymentVersion struct {
	bun.BaseModel `bun:"table:deployment_versions"`
	Version       string `bun:",pk" json:"version"`
	Stage         string `bun:",notnull" json:"stage"`
}

type V19Endpoint

type V19Endpoint struct {
	bun.BaseModel            `bun:"table:endpoints"`
	Id                       int32  `bun:",pk"`
	Address                  string `bun:",notnull"`
	Port                     int32  `bun:",notnull"`
	ClusterId                int32  `bun:"clusterid,notnull"`
	DeploymentVersion        string `bun:"deployment_version,notnull"`
	InitialDeploymentVersion string `bun:"initialdeploymentversion,notnull"`
}

type V23Header

type V23Header struct {
	Name  string
	Value string
}

type V23VirtualHost

type V23VirtualHost struct {
	bun.BaseModel          `bun:"table:virtual_hosts"`
	Id                     int32                  `bun:",pk"`
	Name                   string                 `bun:",notnull"`
	Version                int32                  `bun:",notnull"`
	RouteConfigurationId   int32                  `bun:"routeconfigid,notnull"`
	Domains                []V23VirtualHostDomain `bun:"rel:has-many,join:id=virtualhostid"`
	RequestHeadersToAdd    []V23Header            `bun:"request_header_to_add,type:jsonb"`
	RequestHeadersToRemove []string               `bun:"request_header_to_remove,type:jsonb"`
}

type V23VirtualHostDomain

type V23VirtualHostDomain struct {
	bun.BaseModel `bun:"table:virtual_host_domains"`
	Domain        string `bun:",notnull,pk"`
	Version       int32  `bun:",notnull"`
	VirtualHostId int32  `bun:"virtualhostid,notnull,pk"`
}

type V91Endpoint

type V91Endpoint struct {
	bun.BaseModel            `bun:"endpoints"`
	Id                       int32       `bun:",pk" json:"id"`
	Address                  string      `bun:",notnull"`
	Port                     int32       `bun:",notnull"`
	Protocol                 string      `bun:",notnull"`
	ClusterId                int32       `bun:"clusterid,notnull"`
	Cluster                  *v91Cluster `bun:"rel:belongs-to,join:clusterid=id"`
	DeploymentVersion        string      `bun:"deployment_version,notnull"`
	InitialDeploymentVersion string      `bun:"initialdeploymentversion,notnull"`
	Hostname                 string      `bun:"hostname"`
	OrderId                  int32       `bun:"order_id"`
}

type V132Header

type V132Header struct {
	Name  string
	Value string
}

type V132HeaderMatch

type V132HeaderMatch struct {
	Name           string            `json:",omitempty"`
	ExactMatch     string            `json:",omitempty"`
	SafeRegexMatch string            `json:",omitempty"`
	RangeMatch     *V132RangeMatcher `json:",omitempty"`
	PresentMatch   *bool             `json:",omitempty"`
	PrefixMatch    string            `json:",omitempty"`
	SuffixMatch    string            `json:",omitempty"`
	InvertMatch    bool              `json:",omitempty"`
}

type V132HeaderMatcher

type V132HeaderMatcher struct {
	bun.BaseModel  `bun:"header_matchers"`
	Id             int32           `bun:",pk" json:"id"`
	Name           string          `bun:",notnull" json:"name"`
	Version        int32           `bun:",notnull" json:"version"`
	ExactMatch     string          `bun:"exactmatch" json:"exactMatch"`
	SafeRegexMatch string          `bun:"saferegexmatch" json:"safeRegexMatch"`
	RangeMatch     V132RangeMatch  `bun:"rangematch,type:jsonb" json:"rangeMatch"`
	PresentMatch   domain.NullBool `bun:"presentmatch" json:"presentMatch" swaggertype:"boolean"`
	PrefixMatch    string          `bun:"prefixmatch" json:"prefixMatch"`
	SuffixMatch    string          `bun:"suffixmatch" json:"suffixMatch"`
	InvertMatch    bool            `bun:"invertmatch,default:false" json:"invertMatch" swaggertype:"boolean"`
	RouteId        int32           `bun:"routeid,notnull" json:"-"`
	Route          *V132Route      `bun:"rel:belongs-to,join:routeid=id" json:"-" yaml:"-"`
}

type V132RangeMatch

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

type V132RangeMatcher

type V132RangeMatcher struct {
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

type V132Route

type V132Route struct {
	bun.BaseModel            `bun:"routes"`
	Id                       int32                `bun:",pk" json:"id"`
	Uuid                     string               `bun:"uuid,notnull,type:varchar,unique" json:"uuid"`
	VirtualHostId            int32                `bun:"virtualhostid,notnull" json:"virtualHostId"`
	RouteKey                 string               `bun:"routekey,notnull" json:"routeKey"`
	DirectResponseCode       uint32               `bun:"directresponse_status" json:"directResponseCode"`
	Prefix                   string               `bun:"rm_prefix" json:"prefix"`
	Regexp                   string               `bun:"rm_regexp" json:"regexp"`
	Path                     string               `bun:"rm_path" json:"path"`
	ClusterName              string               `bun:"ra_clustername" json:"clusterName"`
	HostRewrite              string               `bun:"ra_hostrewrite" json:"hostRewrite"`
	HostAutoRewrite          domain.NullBool      `bun:"ra_hostautorewrite" json:"hostAutoRewrite" swaggertype:"boolean"`
	PrefixRewrite            string               `bun:"ra_prefixrewrite" json:"prefixRewrite"`
	RegexpRewrite            string               `bun:"ra_regexprewrite" json:"regexpRewrite"`
	PathRewrite              string               `bun:"ra_pathrewrite" json:"pathRewrite"`
	Version                  int32                `bun:",notnull" json:"version"`
	Timeout                  domain.NullInt       `json:"timeout" swaggertype:"integer"`
	IdleTimeout              domain.NullInt       `bun:"idle_timeout" json:"idleTimeout" swaggertype:"integer"`
	DeploymentVersion        string               `bun:"deployment_version,notnull" json:"deploymentVersionString"`
	InitialDeploymentVersion string               `bun:"initialdeploymentversion,notnull" json:"initialDeploymentVersion"`
	Autogenerated            bool                 `bun:"autogenerated" json:"autogenerated"`
	HeaderMatchers           []*V132HeaderMatcher `bun:"rel:has-many,join:id=routeid" json:"headerMatchers"`
	RequestHeadersToAdd      []V132Header         `bun:"request_header_to_add,type:jsonb"`
	RequestHeadersToRemove   []string             `bun:"request_header_to_remove,type:jsonb"`
	Fallback                 sql.NullBool         `bun:"fallback,type:boolean" swaggertype:"boolean"`
	RateLimitId              string               `bun:"rate_limit_id,nullzero,notnull"`
	StatefulSessionId        int32                `bun:"statefulsessionid,nullzero,notnull" json:"statefulSessionId"`
}

type V132RouteMatch

type V132RouteMatch struct {
	Prefix  string            `json:",omitempty"`
	Regexp  string            `json:",omitempty"`
	Path    string            `json:",omitempty"`
	Headers []V132HeaderMatch `json:",omitempty"`
	Version string            `json:",omitempty"`
}

type V141Cluster

type V141Cluster struct {
	bun.BaseModel `bun:"table:clusters"`

	Id            int32  `bun:",pk" json:"id"`
	Name          string `bun:",notnull" json:"name"`
	LbPolicy      string `bun:"lbpolicy,notnull" json:"lbPolicy"`
	DiscoveryType string `bun:"column:type,notnull" json:"type"`
	Version       int32  `bun:",notnull"`
	HttpVersion   *int32 `bun:"http_version,nullzero,notnull,default:1" json:"httpVersion"`
	EnableH2      bool   `bun:"enableh2" json:"enableH2"`
	TLSId         int32  `bun:"tls_id,nullzero,notnull"`
	//TLS            *TlsConfig      `bun:"rel:belongs-to,join:tls_id=id" json:"tlsConfigName"`
	//NodeGroups     []*NodeGroup    `bun:"m2m:clusters_node_groups,join:Cluster=NodeGroup,notnull"`
	Endpoints []*V141Endpoint `bun:"rel:has-many,join:id=clusterid"`
}

type V141Endpoint

type V141Endpoint struct {
	bun.BaseModel `bun:"table:endpoints"`

	Id                       int32        `bun:",pk"`
	Address                  string       `bun:",notnull"`
	Port                     int32        `bun:",notnull"`
	Protocol                 string       `bun:",scanonly"`
	ClusterId                int32        `bun:"clusterid,nullzero,notnull"`
	Cluster                  *V141Cluster `bun:"rel:belongs-to,join:clusterid=id"`
	DeploymentVersion        string       `bun:"deployment_version,nullzero,notnull"`
	InitialDeploymentVersion string       `bun:"initialdeploymentversion,notnull"`
	//DeploymentVersionVal     *DeploymentVersion `bun:"rel:belongs-to,join:deployment_version=version"`
	//HashPolicies             []*HashPolicy      `bun:"rel:has-many,join:id=endpointid"`
	Hostname          string `bun:"hostname"`
	OrderId           int32  `bun:"order_id"`
	StatefulSessionId int32  `bun:"statefulsessionid,nullzero,notnull" json:"statefulSessionId"`
}

type V141MicroserviceVersion

type V141MicroserviceVersion struct {
	bun.BaseModel `bun:"table:microservice_versions"`

	Name                     string `bun:"name,pk"`
	Namespace                string `bun:"namespace,pk"`
	DeploymentVersion        string `bun:"deployment_version,nullzero,notnull"`
	InitialDeploymentVersion string `bun:"initial_version,notnull,pk"`
}

Jump to

Keyboard shortcuts

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