balance.go 436 字节
Newer Older
E
eoLinker API Management 已提交
1 2
package entity

黄孟柱 已提交
3
import "github.com/eolinker/goku-api-gateway/server/driver"
E
eoLinker API Management 已提交
4

Y
Your Name 已提交
5
//Balance balance
E
eoLinker API Management 已提交
6
type Balance struct {
Y
Your Name 已提交
7 8
	Name          string
	ServiceName   string
E
eoLinker API Management 已提交
9
	ServiceDriver string
Y
Your Name 已提交
10 11 12
	ServiceType   string
	AppName       string
	Static        string
E
eoLinker API Management 已提交
13 14 15
	StaticCluster string
}

Y
Your Name 已提交
16
//Type type
Y
Your Name 已提交
17
func (e *Balance) Type() *Balance {
E
eoLinker API Management 已提交
18

Y
Your Name 已提交
19
	if e != nil {
E
eoLinker API Management 已提交
20

Y
Your Name 已提交
21 22
		d, has := driver.Get(e.ServiceDriver)
		if has {
E
eoLinker API Management 已提交
23 24 25 26 27
			e.ServiceType = d.Type
		}
	}

	return e
Y
Your Name 已提交
28
}