strategy_dto

package
v1.3.2-beta Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeGlobal  = "global"
	ScopeTeam    = "team"
	ScopeService = "service"

	PublishStatusOnline  = "online"
	PublishStatusOffline = "offline"
	PublishStatusUpdate  = "update"
	PublishStatusDelete  = "delete"
)

Variables

This section is empty.

Functions

func StrategyStatus

func StrategyStatus(s *strategy.Strategy, publishVersion string) string

Types

type Create

type Create struct {
	Scope    Scope       `json:"-"`
	Target   string      `json:"-"`
	Driver   string      `json:"-"`
	ID       string      `json:"id"`
	Name     string      `json:"name"`
	Priority int         `json:"priority"`
	Desc     string      `json:"desc"`
	Filters  []*Filter   `json:"filters"`
	Config   interface{} `json:"config"`
}

type Edit

type Edit struct {
	Name     *string      `json:"name"`
	Priority *int         `json:"priority"`
	Desc     *string      `json:"desc"`
	Filters  *[]*Filter   `json:"filters"`
	Config   *interface{} `json:"config"`
}

type Filter

type Filter struct {
	Name   string   `json:"name"`
	Values []string `json:"values"`
	Type   string   `json:"type"`
	Label  string   `json:"label"`
	Title  string   `json:"title"`
}

type FilterOption

type FilterOption struct {
	Name    string   `json:"name"`
	Title   string   `json:"title"`
	Type    string   `json:"type"`
	Pattern string   `json:"pattern"`
	Options []string `json:"options"`
}

type LogInfo

type LogInfo struct {
	ID                string `json:"id"`
	ContentType       string `json:"content_type"`
	ProxyResponseBody string `json:"origin"`
	ResponseBody      string `json:"target"`
}

type LogItem

type LogItem struct {
	ID            string         `json:"id"`
	Service       auto.Label     `json:"service" aolabel:"service"`
	Method        string         `json:"method"`
	Url           string         `json:"url"`
	RemoteIP      string         `json:"remote_ip"`
	Consumer      auto.Label     `json:"consumer" aolabel:"service"`
	Authorization auto.Label     `json:"authorization" aolabel:"service_authorization"`
	RecordTime    auto.TimeLabel `json:"record_time"`
}

type Scope

type Scope int

func ToScope

func ToScope(s string) Scope

func (Scope) Int

func (s Scope) Int() int

func (Scope) String

func (s Scope) String() string

type Strategy

type Strategy struct {
	Id       string      `json:"id"`
	Name     string      `json:"name"`
	Priority int         `json:"priority"`
	Desc     string      `json:"desc"`
	Filters  []*Filter   `json:"filters"`
	Config   interface{} `json:"config"`
	IsDelete bool        `json:"is_delete"`
}

func ToStrategy

func ToStrategy(s *strategy.Strategy) *Strategy

type StrategyItem

type StrategyItem struct {
	Id             string         `json:"id"`
	Name           string         `json:"name"`
	Priority       int            `json:"priority"`
	Desc           string         `json:"desc"`
	Filters        string         `json:"filters"`
	Updater        auto.Label     `json:"updater" aolabel:"user"`
	UpdateTime     auto.TimeLabel `json:"update_time"`
	ProcessedTotal int64          `json:"processed_total"`
	PublishStatus  string         `json:"publish_status"`
	IsStop         bool           `json:"is_stop"`
	IsDelete       bool           `json:"is_delete"`
}

func ToStrategyItem

func ToStrategyItem(s *strategy.Strategy, publishVersion string, filters string, processedTotal int64) *StrategyItem

type Title

type Title struct {
	Field string `json:"field"`
	Title string `json:"title" aoi18n:""`
}

type ToPublishItem

type ToPublishItem struct {
	Name     string    `json:"name"`
	Priority int       `json:"priority"`
	Status   string    `json:"status"`
	OptTime  time.Time `json:"opt_time"`
}

Jump to

Keyboard shortcuts

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