Ejemplo n.º 1
0
func createBucket(cluster *Cluster, config *gocbcore.AgentConfig) (*Bucket, error) {
	cli, err := gocbcore.CreateAgent(config)
	if err != nil {
		return nil, err
	}

	bucket := &Bucket{
		cluster:    cluster,
		name:       config.BucketName,
		password:   config.Password,
		client:     cli,
		mtEnabled:  config.UseMutationTokens,
		transcoder: &DefaultTranscoder{},

		opTimeout:       2500 * time.Millisecond,
		duraTimeout:     40000 * time.Millisecond,
		duraPollTimeout: 100 * time.Millisecond,
		viewTimeout:     75 * time.Second,
		n1qlTimeout:     75 * time.Second,
		ftsTimeout:      75 * time.Second,
	}
	bucket.internal = &BucketInternal{
		b: bucket,
	}
	return bucket, nil
}
Ejemplo n.º 2
0
func createBucket(config *gocbcore.AgentConfig) (*Bucket, error) {
	cli, err := gocbcore.CreateAgent(config)
	if err != nil {
		return nil, err
	}

	return &Bucket{
		name:       config.BucketName,
		password:   config.Password,
		client:     cli,
		transcoder: &DefaultTranscoder{},
		queryCache: make(map[string]*n1qlCache),

		opTimeout:       2500 * time.Millisecond,
		duraTimeout:     40000 * time.Millisecond,
		duraPollTimeout: 100 * time.Millisecond,
	}, nil
}