github.com/hashicorp/vault/sdk@v0.13.0/database/helper/connutil/connutil.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package connutil
     5  
     6  import (
     7  	"context"
     8  	"errors"
     9  	"sync"
    10  )
    11  
    12  var ErrNotInitialized = errors.New("connection has not been initialized")
    13  
    14  // ConnectionProducer can be used as an embedded interface in the Database
    15  // definition. It implements the methods dealing with individual database
    16  // connections and is used in all the builtin database types.
    17  type ConnectionProducer interface {
    18  	Close() error
    19  	Init(context.Context, map[string]interface{}, bool) (map[string]interface{}, error)
    20  	Connection(context.Context) (interface{}, error)
    21  
    22  	sync.Locker
    23  
    24  	// DEPRECATED, will be removed in 0.12
    25  	Initialize(context.Context, map[string]interface{}, bool) error
    26  }