Documentation ¶
Index ¶
- func DeltaAddress(addr string, portDelta int) (string, bool)
- func GetCommand(c *ShosetConn) (msg.Message, error)
- func GetConfig(c *ShosetConn) (msg.Message, error)
- func GetConfigBye(c *ShosetConn) (msg.Message, error)
- func GetConfigJoin(c *ShosetConn) (msg.Message, error)
- func GetConfigLink(c *ShosetConn) (msg.Message, error)
- func GetEvent(c *ShosetConn) (msg.Message, error)
- func GetIP(address string) (string, error)
- func HandleCommand(c *ShosetConn, message msg.Message) error
- func HandleConfig(c *ShosetConn, message msg.Message) error
- func HandleConfigBye(c *ShosetConn, message msg.Message) error
- func HandleConfigJoin(c *ShosetConn, message msg.Message) error
- func HandleConfigLink(c *ShosetConn, message msg.Message) error
- func HandleEvent(c *ShosetConn, message msg.Message) error
- func IP2ID(ip string) (uint64, bool)
- func SendCommand(c *Shoset, cmd msg.Message)
- func SendConfig(c *Shoset, cmd msg.Message)
- func SendEvent(c *Shoset, evt msg.Message)
- func SendEventConn(c *ShosetConn, evt interface{})
- func WaitCommand(c *Shoset, replies *msg.Iterator, args map[string]string, timeout int) *msg.Message
- func WaitConfig(c *Shoset, replies *msg.Iterator, args map[string]string, timeout int) *msg.Message
- func WaitEvent(c *Shoset, replies *msg.Iterator, args map[string]string, timeout int) *msg.Message
- type MapSafe
- type MapSafeBool
- type MapSafeConn
- func (m *MapSafeConn) Delete(key string)
- func (m *MapSafeConn) Get(key string) *ShosetConn
- func (m *MapSafeConn) GetByType(shosetType string) []*ShosetConn
- func (m *MapSafeConn) GetM() map[string]*ShosetConn
- func (m *MapSafeConn) Iterate(iter func(string, *ShosetConn))
- func (m *MapSafeConn) Keys(dir string) []string
- func (m *MapSafeConn) Len() int
- func (m *MapSafeConn) Set(key string, value *ShosetConn) *MapSafeConn
- type MapSafeMapConn
- func (m *MapSafeMapConn) Delete(lname, key string)
- func (m *MapSafeMapConn) Get(key string) *MapSafeConn
- func (m *MapSafeMapConn) GetConfig() ([]string, []string)
- func (m *MapSafeMapConn) Iterate(lname string, iter func(string, *ShosetConn))
- func (m *MapSafeMapConn) IterateAll(iter func(string, *ShosetConn))
- func (m *MapSafeMapConn) Keys() []string
- func (m *MapSafeMapConn) Len() int
- func (m *MapSafeMapConn) Set(lname, key, protocolType, shosetType string, value *ShosetConn) *MapSafeMapConn
- func (m *MapSafeMapConn) SetConfigName(name string)
- func (m *MapSafeMapConn) SetViper(viperConfig *viper.Viper)
- type MapSafeStrings
- func (m *MapSafeStrings) Delete(key string)
- func (m *MapSafeStrings) Get(key string) map[string]bool
- func (m *MapSafeStrings) Iterate(iter func(string, map[string]bool))
- func (m *MapSafeStrings) Keys(key string) []string
- func (m *MapSafeStrings) Len() int
- func (m *MapSafeStrings) Set(key, value string)
- type MessageHandlers
- type Shoset
- func (c *Shoset) Bind(address string) error
- func (c Shoset) GetBindAddress() string
- func (c *Shoset) GetConnsByType(shosetType string) map[string]*ShosetConn
- func (c *Shoset) GetConnsByTypeArray(shosetType string) []*ShosetConn
- func (c *Shoset) GetIsValid() bool
- func (c Shoset) GetLogicalName() string
- func (c Shoset) GetShosetType() string
- func (c *Shoset) Protocol(address, protocolType string) (*ShosetConn, error)
- func (c *Shoset) SetBindAddress(bindAddress string)
- func (c *Shoset) SetIsValid(state bool)
- func (c Shoset) String() string
- type ShosetConn
- func (c *ShosetConn) Flush() error
- func (c *ShosetConn) GetCh() *Shoset
- func (c *ShosetConn) GetDir() string
- func (c *ShosetConn) GetIsValid() bool
- func (c *ShosetConn) GetLocalAddress() string
- func (c *ShosetConn) GetLocalLogicalName() string
- func (c *ShosetConn) GetLocalShosetType() string
- func (c *ShosetConn) GetRemoteAddress() string
- func (c *ShosetConn) GetRemoteLogicalName() string
- func (c *ShosetConn) GetRemoteShosetType() string
- func (c *ShosetConn) ReadMessage(data interface{}) error
- func (c *ShosetConn) ReadString() (string, error)
- func (c *ShosetConn) SendMessage(msg msg.Message)
- func (c *ShosetConn) SetIsValid(state bool)
- func (c *ShosetConn) SetLocalAddress(bindAddress string)
- func (c *ShosetConn) SetRemoteAddress(address string)
- func (c *ShosetConn) SetRemoteLogicalName(lName string)
- func (c *ShosetConn) SetRemoteShosetType(ShosetType string)
- func (c *ShosetConn) String() string
- func (c *ShosetConn) WriteMessage(data interface{}) error
- func (c *ShosetConn) WriteString(data string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeltaAddress ¶
DeltaAddress return a new address with same host but with a new port (old one with an offset)
func GetConfig ¶
func GetConfig(c *ShosetConn) (msg.Message, error)
TODO MOVE TO GANDALF GetConfig :
func HandleConfig ¶
func HandleConfig(c *ShosetConn, message msg.Message) error
HandleConfig :config
func HandleConfigBye ¶
func HandleConfigBye(c *ShosetConn, message msg.Message) error
HandleConfigBye :
func HandleConfigJoin ¶
func HandleConfigJoin(c *ShosetConn, message msg.Message) error
HandleConfigJoin :
func HandleConfigLink ¶
func HandleConfigLink(c *ShosetConn, message msg.Message) error
HandleConfigLink :
func WaitCommand ¶
func WaitCommand(c *Shoset, replies *msg.Iterator, args map[string]string, timeout int) *msg.Message
WaitCommand :
func WaitConfig ¶
WaitConfig :
Types ¶
type MapSafe ¶
MapSafe : simple key map safe for goroutines...
type MapSafeBool ¶
MapSafeBool : simple key map safe for goroutines...
func (*MapSafeBool) Delete ¶
func (m *MapSafeBool) Delete(key string)
Delete : delete a value in a MapSafeBool
func (*MapSafeBool) Get ¶
func (m *MapSafeBool) Get(key string) bool
Get : Get a value from a MapSafeBool
func (*MapSafeBool) Iterate ¶
func (m *MapSafeBool) Iterate(iter func(string, bool))
Iterate : iterate through MapSafeBool Values using a function
func (*MapSafeBool) Set ¶
func (m *MapSafeBool) Set(key string, value bool) *MapSafeBool
Set : assign a value to a MapSafeBool
type MapSafeConn ¶
MapSafeConn : simple key map safe for goroutines...
func (*MapSafeConn) Delete ¶
func (m *MapSafeConn) Delete(key string)
Delete : delete a value in a MapSafeConn
func (*MapSafeConn) Get ¶
func (m *MapSafeConn) Get(key string) *ShosetConn
Get : Get a value from a MapSafeConn
func (*MapSafeConn) GetByType ¶
func (m *MapSafeConn) GetByType(shosetType string) []*ShosetConn
Get : Get a value from a MapSafeConn
func (*MapSafeConn) Iterate ¶
func (m *MapSafeConn) Iterate(iter func(string, *ShosetConn))
Iterate : iterate through MapSafeConn Values using a function
func (*MapSafeConn) Keys ¶
func (m *MapSafeConn) Keys(dir string) []string
func (*MapSafeConn) Set ¶
func (m *MapSafeConn) Set(key string, value *ShosetConn) *MapSafeConn
Set : assign a value to a MapSafeConn
type MapSafeMapConn ¶
type MapSafeMapConn struct { sync.Mutex ConfigName string // contains filtered or unexported fields }
MapSafeMapConn : simple key map safe for goroutines...
func (*MapSafeMapConn) Delete ¶
func (m *MapSafeMapConn) Delete(lname, key string)
Delete : delete a value in a MapSafeMapConn
func (*MapSafeMapConn) Get ¶
func (m *MapSafeMapConn) Get(key string) *MapSafeConn
Get : Get a value from a MapSafeMapConn
func (*MapSafeMapConn) GetConfig ¶
func (m *MapSafeMapConn) GetConfig() ([]string, []string)
func (*MapSafeMapConn) Iterate ¶
func (m *MapSafeMapConn) Iterate(lname string, iter func(string, *ShosetConn))
Iterate : iterate through MapSafeMapConn Values using a function
func (*MapSafeMapConn) IterateAll ¶
func (m *MapSafeMapConn) IterateAll(iter func(string, *ShosetConn))
func (*MapSafeMapConn) Keys ¶
func (m *MapSafeMapConn) Keys() []string
func (*MapSafeMapConn) Set ¶
func (m *MapSafeMapConn) Set(lname, key, protocolType, shosetType string, value *ShosetConn) *MapSafeMapConn
Set : assign a value to a MapSafeMapConn
func (*MapSafeMapConn) SetConfigName ¶
func (m *MapSafeMapConn) SetConfigName(name string)
func (*MapSafeMapConn) SetViper ¶
func (m *MapSafeMapConn) SetViper(viperConfig *viper.Viper)
type MapSafeStrings ¶
MapSafeStrings : simple key map safe for goroutines...
func (*MapSafeStrings) Delete ¶
func (m *MapSafeStrings) Delete(key string)
Delete : delete a value in a MapSafeStrings
func (*MapSafeStrings) Get ¶
func (m *MapSafeStrings) Get(key string) map[string]bool
Get : Get a value from a MapSafeStrings
func (*MapSafeStrings) Iterate ¶
func (m *MapSafeStrings) Iterate(iter func(string, map[string]bool))
Iterate : iterate through MapSafeStrings Values using a function
func (*MapSafeStrings) Keys ¶
func (m *MapSafeStrings) Keys(key string) []string
func (*MapSafeStrings) Set ¶
func (m *MapSafeStrings) Set(key, value string)
type MessageHandlers ¶
type MessageHandlers interface { Handle(*ShosetConn) error SendConn(*ShosetConn, *msg.Message) Send(*Shoset, *msg.Message) Wait(*Shoset, *msg.Iterator, string, int) *msg.Message }
MessageHandlers interface
type Shoset ¶
type Shoset struct { Context map[string]interface{} //TOTO // id string ConnsByName *MapSafeMapConn // map[string]map[string]*ShosetConn connexions par nom logique LnamesByType *MapSafeStrings // for gandalf LnamesByProtocol *MapSafeStrings ShosetType string // Type logique de la shoset // Dictionnaire des queues de message (par type de message) Queue map[string]*msg.Queue Get map[string]func(*ShosetConn) (msg.Message, error) Handle map[string]func(*ShosetConn, msg.Message) error Send map[string]func(*Shoset, msg.Message) Wait map[string]func(*Shoset, *msg.Iterator, map[string]string, int) *msg.Message // synchronisation des goroutines Done chan bool // contains filtered or unexported fields }
Shoset :
func (*Shoset) GetConnsByType ¶
func (c *Shoset) GetConnsByType(shosetType string) map[string]*ShosetConn
func (*Shoset) GetConnsByTypeArray ¶
func (c *Shoset) GetConnsByTypeArray(shosetType string) []*ShosetConn
func (*Shoset) GetIsValid ¶
func (Shoset) GetLogicalName ¶
func (Shoset) GetShosetType ¶
func (*Shoset) Protocol ¶
func (c *Shoset) Protocol(address, protocolType string) (*ShosetConn, error)
func (*Shoset) SetBindAddress ¶
func (*Shoset) SetIsValid ¶
type ShosetConn ¶
type ShosetConn struct {
// contains filtered or unexported fields
}
ShosetConn : client connection
func GetByType ¶
func GetByType(m *MapSafeConn, shosetType string) []*ShosetConn
GetByType : Get shoset by type.
func NewShosetConn ¶
func NewShosetConn(c *Shoset, address string, dir string) (*ShosetConn, error)
func (*ShosetConn) GetIsValid ¶
func (c *ShosetConn) GetIsValid() bool
func (*ShosetConn) GetLocalAddress ¶
func (c *ShosetConn) GetLocalAddress() string
GetBindAddr : port sur lequel on est bindé
func (*ShosetConn) GetLocalLogicalName ¶
func (c *ShosetConn) GetLocalLogicalName() string
func (*ShosetConn) GetLocalShosetType ¶
func (c *ShosetConn) GetLocalShosetType() string
func (*ShosetConn) GetRemoteAddress ¶
func (c *ShosetConn) GetRemoteAddress() string
func (*ShosetConn) GetRemoteLogicalName ¶
func (c *ShosetConn) GetRemoteLogicalName() string
GetName : // remote logical Name
func (*ShosetConn) GetRemoteShosetType ¶
func (c *ShosetConn) GetRemoteShosetType() string
GetShosetType : // remote ShosetTypeName
func (*ShosetConn) ReadMessage ¶
func (c *ShosetConn) ReadMessage(data interface{}) error
ReadMessage :
func (*ShosetConn) SetIsValid ¶
func (c *ShosetConn) SetIsValid(state bool)
func (*ShosetConn) SetLocalAddress ¶
func (c *ShosetConn) SetLocalAddress(bindAddress string)
SetBindAddr :
func (*ShosetConn) SetRemoteAddress ¶
func (c *ShosetConn) SetRemoteAddress(address string)
func (*ShosetConn) SetRemoteLogicalName ¶
func (c *ShosetConn) SetRemoteLogicalName(lName string)
SetName : // remote logical Name
func (*ShosetConn) SetRemoteShosetType ¶
func (c *ShosetConn) SetRemoteShosetType(ShosetType string)
SetShosetType : // remote ShosetType
func (*ShosetConn) String ¶
func (c *ShosetConn) String() string
func (*ShosetConn) WriteMessage ¶
func (c *ShosetConn) WriteMessage(data interface{}) error
WriteMessage :
func (*ShosetConn) WriteString ¶
func (c *ShosetConn) WriteString(data string) (int, error)
WriteString :