Documentation
¶
Index ¶
Constants ¶
const ( // Base64Prefix is the prefix for Base64 format exports Base64Prefix = "TGB64" // CurrentVersion is the current export format version CurrentVersion = "1.0" )
Variables ¶
This section is empty.
Functions ¶
func DecodeBase64Export ¶
DecodeBase64Export decodes a Base64 export back to JSONL content
Types ¶
type Base64Exporter ¶
type Base64Exporter struct {
// contains filtered or unexported fields
}
Base64Exporter exports data in Base64-encoded JSONL format
func NewBase64Exporter ¶
func NewBase64Exporter() *Base64Exporter
NewBase64Exporter creates a new Base64 exporter
func (*Base64Exporter) Export ¶
func (e *Base64Exporter) Export(req *ExportRequest) (*ExportResult, error)
Export performs the export in Base64 format
func (*Base64Exporter) Format ¶
func (e *Base64Exporter) Format() Format
Format returns the format type
type ExportLine ¶
type ExportLine struct {
Type string `json:"type"`
}
ExportLine is the base type for all export lines
type ExportMetadata ¶
type ExportMetadata struct {
Type string `json:"type"`
Version string `json:"version"`
ExportedAt string `json:"exported_at"`
}
ExportMetadata represents the metadata line
type ExportProviderData ¶
type ExportProviderData struct {
Type string `json:"type"`
UUID string `json:"uuid"`
Name string `json:"name"`
APIBase string `json:"api_base"`
APIStyle string `json:"api_style"`
AuthType string `json:"auth_type"`
Token string `json:"token"`
OAuthDetail *typ.OAuthDetail `json:"oauth_detail"`
Enabled bool `json:"enabled"`
ProxyURL string `json:"proxy_url"`
Timeout int64 `json:"timeout"`
Tags []string `json:"tags"`
Models []string `json:"models"`
}
ExportProviderData represents the provider export data
type ExportRequest ¶
ExportRequest contains the data needed for export
type ExportResult ¶
ExportResult represents the result of an export operation
func Export ¶
func Export(req *ExportRequest, format Format) (*ExportResult, error)
Export exports a rule with its providers in the specified format
type ExportRuleData ¶
type ExportRuleData struct {
Type string `json:"type"`
UUID string `json:"uuid"`
Scenario string `json:"scenario"`
RequestModel string `json:"request_model"`
ResponseModel string `json:"response_model"`
Description string `json:"description"`
Services []*loadbalance.Service `json:"services"`
LBTactic typ.Tactic `json:"lb_tactic"`
Active bool `json:"active"`
SmartEnabled bool `json:"smart_enabled"`
SmartRouting []interface{} `json:"smart_routing"`
}
ExportRuleData represents the rule export data
type Exporter ¶
type Exporter interface {
Export(req *ExportRequest) (*ExportResult, error)
Format() Format
}
Exporter defines the interface for export implementations
func NewExporter ¶
NewExporter creates an exporter for the specified format
type JSONLExporter ¶
type JSONLExporter struct{}
JSONLExporter exports data in JSONL format
func NewJSONLExporter ¶
func NewJSONLExporter() *JSONLExporter
NewJSONLExporter creates a new JSONL exporter
func (*JSONLExporter) Export ¶
func (e *JSONLExporter) Export(req *ExportRequest) (*ExportResult, error)
Export performs the export in JSONL format
func (*JSONLExporter) Format ¶
func (e *JSONLExporter) Format() Format
Format returns the format type