Documentation ¶
Index ¶
- func CleanAll(ctx context.Context, conf *Config, ...) error
- func FilterNotUsedWithin(d time.Duration) func(sdb *model.SpoolDatabase) bool
- func FilterState(state State) func(sdb *model.SpoolDatabase) bool
- func ListAll(ctx context.Context, conf *Config) ([]*model.SpoolDatabase, error)
- func Setup(ctx context.Context, conf *Config) error
- type Config
- type Pool
- func (p *Pool) Clean(ctx context.Context, filters ...func(sdb *model.SpoolDatabase) bool) error
- func (p *Pool) Create(ctx context.Context, dbNamePrefix string) (*model.SpoolDatabase, error)
- func (p *Pool) Get(ctx context.Context) (*model.SpoolDatabase, error)
- func (p *Pool) GetOrCreate(ctx context.Context, dbNamePrefix string) (*model.SpoolDatabase, error)
- func (p *Pool) List(ctx context.Context) ([]*model.SpoolDatabase, error)
- func (p *Pool) Put(ctx context.Context, dbName string) error
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAll ¶
func CleanAll(ctx context.Context, conf *Config, filters ...func(sdb *model.SpoolDatabase) bool) error
CleanAll removes all idle databases.
func FilterNotUsedWithin ¶
func FilterNotUsedWithin(d time.Duration) func(sdb *model.SpoolDatabase) bool
FilterNotUsedWithin returns a function which reports whether sdb is not used within d.
func FilterState ¶
func FilterState(state State) func(sdb *model.SpoolDatabase) bool
FilterState returns a function which reports whether sdb.State is state.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func NewConfig ¶
func NewConfig(projectID, instanceID, databaseID string, opts ...option.ClientOption) *Config
func (*Config) ClientOptions ¶
func (c *Config) ClientOptions() []option.ClientOption
func (*Config) DatabaseID ¶
func (*Config) InstanceID ¶
func (*Config) WithDatabaseID ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a Spanner database pool.
func (*Pool) GetOrCreate ¶
GetOrCreate gets a idle database or creates a new database.
Click to show internal directories.
Click to hide internal directories.