fieldalignment of all structs to save memory

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-03-06 19:45:13 +03:00
parent cb70dfa664
commit bbbcb22565
65 changed files with 667 additions and 671 deletions

View File

@@ -10,23 +10,15 @@ import (
// Options are router options
type Options struct {
Name string
// Id is router id
Id string
// Address is router address
Address string
// Gateway is network gateway
Gateway string
// Network is network address
Network string
// Register is the local register
Logger logger.Logger
Context context.Context
Register register.Register
// Precache routes
Name string
Gateway string
Network string
Id string
Address string
Precache bool
// Logger
Logger logger.Logger
// Context for additional options
Context context.Context
}
// Id sets Router Id

View File

@@ -15,10 +15,10 @@ var (
// Route is network route
type Route struct {
// Metadata for the route
Metadata metadata.Metadata
// Service is destination service name
Service string
// Address is service node address
Address string
// Gateway is route gateway
Gateway string
// Network is network address
@@ -27,10 +27,10 @@ type Route struct {
Router string
// Link is network link
Link string
// Address is service node address
Address string
// Metric is the route cost metric
Metric int64
// Metadata for the route
Metadata metadata.Metadata
}
// Hash returns route hash sum.

View File

@@ -38,14 +38,14 @@ func (t EventType) String() string {
// Event is returned by a call to Next on the watcher.
type Event struct {
// Unique id of the event
// Route is table route
Route Route
// Timestamp is event timestamp
Timestamp time.Time
// Id of the event
Id string
// Type defines type of event
Type EventType
// Timestamp is event timestamp
Timestamp time.Time
// Route is table route
Route Route
}
// Watcher defines routing table watcher interface