Dispatcher with support for dynamic hosts

This commit is contained in:
DanB
2019-04-01 18:32:38 +02:00
parent 8b2b5dece0
commit fccaf489a4
11 changed files with 238 additions and 226 deletions

View File

@@ -1182,15 +1182,6 @@ type TPTntID struct {
ID string
}
// TPDispatcherConns is used in TPDispatcherProfile
type TPDispatcherConns struct {
ID string
FilterIDs []string
Weight float64 // applied in case of multiple connections need to be ordered
Params []interface{} // additional parameters stored for a session
Blocker bool // no connection after this one
}
// TPDispatcherProfile is used in APIs to manage remotely offline DispatcherProfile
type TPDispatcherProfile struct {
TPid string
@@ -1202,7 +1193,24 @@ type TPDispatcherProfile struct {
Strategy string
StrategyParams []interface{} // ie for distribution, set here the pool weights
Weight float64
Conns []*TPDispatcherConns
Hosts []*TPDispatcherHostProfile
}
// TPDispatcherHostProfile is used in TPDispatcherProfile
type TPDispatcherHostProfile struct {
ID string
FilterIDs []string
Weight float64 // applied in case of multiple connections need to be ordered
Params []interface{} // additional parameters stored for a session
Blocker bool // no connection after this one
}
// TPDispatcherHost is used in APIs to manage remotely offline DispatcherHost
type TPDispatcherHost struct {
TPid string
Tenant string
ID string
Conns []*TPDispatcherHostConn
}
// TPDispatcherHostConn is used in TPDispatcherHost
@@ -1212,14 +1220,6 @@ type TPDispatcherHostConn struct {
TLS bool
}
// TPDispatcherHostTPDispatcherHost is used in APIs to manage remotely offline DispatcherHost
type TPDispatcherHost struct {
TPid string
Tenant string
ID string
Conns []*TPDispatcherHostConn
}
type UsageInterval struct {
Min *time.Duration
Max *time.Duration

View File

@@ -74,6 +74,7 @@ var (
ErrCDRCNoProfileID = errors.New("CDRC_PROFILE_WITHOUT_ID")
ErrCDRCNoInDir = errors.New("CDRC_PROFILE_WITHOUT_IN_DIR")
ErrNotEnoughParameters = errors.New("NotEnoughParameters")
ErrNotConnected = errors.New("NOT_CONNECTED")
RalsErrorPrfx = "RALS_ERROR"
DispatcherErrorPrefix = "DISPATCHER_ERROR"
)