balance.go 394 字节
Newer Older
E
eoLinker API Management 已提交
1 2 3 4 5
package entity

import "github.com/eolinker/goku/server/driver"

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

Y
Your Name 已提交
15
func (e *Balance) Type() *Balance {
E
eoLinker API Management 已提交
16

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

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

	return e
Y
Your Name 已提交
26
}