httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/spf13/viper"
- "math/rand"
"sync"
"time"
)
RanName string
}
-var seedSN uint16
-
const (
CREATE Action = 0
MERGE Action = 1
viper.AutomaticEnv()
viper.SetEnvPrefix("submgr")
viper.AllowEmptyEnv(true)
- seedSN = uint16(viper.GetInt("seed_sn"))
- if seedSN == 0 {
- rand.Seed(time.Now().UnixNano())
- seedSN = uint16(rand.Intn(65535))
- }
- if seedSN > 65535 {
- seedSN = 0
- }
- xapp.Logger.Info("SUBMGR: Initial Sequence Number: %v", seedSN)
}
func NewControl() *Control {
rtmgrClient := RtmgrClient{client, handle, deleteHandle}
registry := new(Registry)
- registry.Initialize(seedSN)
+ registry.Initialize()
registry.rtmgrClient = &rtmgrClient
tracker := new(Tracker)