Documentation ¶
Index ¶
- type ConnAddr
- func (a *ConnAddr) Add(addr ...string)
- func (a *ConnAddr) AsMap() map[string]*grpc.ClientConn
- func (a *ConnAddr) Get(k string) *grpc.ClientConn
- func (a *ConnAddr) Keys() []string
- func (a *ConnAddr) Len() int
- func (a *ConnAddr) Reset()
- func (a *ConnAddr) Set(k string, conn *grpc.ClientConn)
- func (a *ConnAddr) Unset(addr ...string)
- func (a *ConnAddr) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnAddr ¶
type ConnAddr map[string]*grpc.ClientConn
ConnAddr is a map of addresses which refer to pointers to grpc.ClientConn
This map is used to build dynamic connections for gRPC Loggers.
func New ¶
New function will take in any number of addr and initialize a ConnAddr object with those addresses. Then, returns a pointer to this ConnAddr object.
func (*ConnAddr) Add ¶
Add method will allocate the input strings as entries in the map, with initialized pointers to grpc.ClientConn
func (*ConnAddr) AsMap ¶
func (a *ConnAddr) AsMap() map[string]*grpc.ClientConn
Map method will return a ConnAddr object in a map[string]*grpc.ClientConn format
func (*ConnAddr) Get ¶
func (a *ConnAddr) Get(k string) *grpc.ClientConn
Get method will return the pointer to a grpc.ClientConn, as referenced in the input address k
func (*ConnAddr) Keys ¶
Keys method will return a ConnAddr object's keys (its addresses) in a slice of strings
func (*ConnAddr) Reset ¶
func (a *ConnAddr) Reset()
Reset method will overwrite the existing ConnAddr map with a new, empty one.
func (*ConnAddr) Set ¶
func (a *ConnAddr) Set(k string, conn *grpc.ClientConn)
Set method will allocate the input connection to the input string, within the ConnAddr map (overwritting it if existing)
func (*ConnAddr) Unset ¶
Unset method will remove the input addr strings from the ConnAddr map, if existing
func (*ConnAddr) Write ¶
Write method is an implementation of io.Writer, so that the ConnAddr map can be used in a gRPC Logger's SetOuts() and AddOuts() methods. These need to conform with the Logger interface that implements these methods with a variatic number of io.Writer.
For the same layer of compatibility to be possible in a gRPC Logger (who will write its log entries in a remote server), it uses these methods to implement its way of altering the existing connections, instead of dismissing this part of the implementation all together.
...That being said -- this is not any io.Writer.