// Open method are opens the component.
// Parameters:
//   - correlationId 	(optional) transaction id to trace execution through call chain.
// Retruns: error or nil no errors occured.
Open method are opens the component.
Parameters:
- correlationId 	(optional) transaction id to trace execution through call chain.
Retruns: error or nil no errors occured.
// Open method are opens the component . // Parameters : // - correlationId ( optional ) transaction id to trace execution through call chain . // Retruns : error or nil no errors occured .
func (c *MemcachedCache) Open(correlationId string) error {
	connections, err := c.connectionResolver.ResolveAll(correlationId)
	if err == nil && len(connections) == 0 {
		err = cerr.NewConfigError(correlationId, "NO_CONNECTION", "Connection is not configured")
	}
	if err != nil {
		return err
	}
	var servers []string = make([]string, 0)
	for _, connection := range connections {
		host := connection.Host()
		port := connection.Port()
		if port == 0 {
			port = 11211
		}
		servers = append(servers, host+":"+strconv.FormatInt(int64(port), 10))
	}
	c.client = memcache.New(servers...)
	c.client.Timeout = time.Duration(c.timeout) * time.Millisecond
	return nil
}
func ( c * MemcachedCache ) Open ( correlationId string ) error { connections , err := c . connectionResolver . ResolveAll ( correlationId ) if err == nil && len ( connections ) == 0 { err = cerr . NewConfigError ( correlationId , " " , " " ) } if err != nil { return err } var servers [ ] string = make ( [ ] string , 0 ) for _ , connection := range connections { host := connection . Host ( ) port := connection . Port ( ) if port == 0 { port = 11211 } servers = append ( servers , host + " " + strconv . FormatInt ( int64 ( port ) , 10 ) ) } c . client = memcache . New ( servers ... ) c . client . Timeout = time . Duration ( c . timeout ) * time . Millisecond return nil }
Open method are opens the component.
Open method are opens the component .
// options = { //     maxKeySize: c.maxKeySize, //     maxExpiration: c.maxExpiration, //     maxValue: c.maxValue, //     poolSize: c.poolSize, //     reconnect: c.reconnect, //     timeout: c.timeout, //     retries: c.retries, //     failures: c.failures, //     retry: c.retry, //     remove: c.remove, //     idle: c.idle // }; //c.client.MaxIdleConns = c.idle