sql

package
v0.0.73 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type CompletedConfig

type CompletedConfig struct {
	// contains filtered or unexported fields
}

func (CompletedConfig) New

func (c CompletedConfig) New(ctx context.Context) *sqlx.DB

New creates a new server which logically combines the handling chain with the passed server. name is used to differentiate for logging. The handler chain in particular can be difficult as it starts delgating. New usually called after Complete

func (CompletedConfig) Validate added in v0.0.44

func (c CompletedConfig) Validate() error

Validate checks Config.

type Config

type Config struct {
	Proto     Database
	Validator *validator.Validate
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

NewConfig returns a Config struct with the default values

func NewViperConfig added in v0.0.17

func NewViperConfig(v *viper.Viper, keys ...string) *Config

NewViperConfig returns a Config struct with the global viper instance key representing a sub tree of this instance. NewViperConfig is case-insensitive for a key.

func (*Config) Complete

func (c *Config) Complete() CompletedConfig

Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to ApplyOptions, do that first. It's mutating the receiver. ApplyOptions is called inside.

type Database added in v0.0.18

type Database struct {
	Dsn               string               `protobuf:"bytes,1,opt,name=dsn,proto3" json:"dsn,omitempty"` // memory|schema://[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]
	MaxWaitDuration   *durationpb.Duration `protobuf:"bytes,2,opt,name=max_wait_duration,json=maxWaitDuration,proto3" json:"max_wait_duration,omitempty"`
	FailAfterDuration *durationpb.Duration `protobuf:"bytes,3,opt,name=fail_after_duration,json=failAfterDuration,proto3" json:"fail_after_duration,omitempty"`
	// contains filtered or unexported fields
}

func (*Database) Descriptor deprecated added in v0.0.18

func (*Database) Descriptor() ([]byte, []int)

Deprecated: Use Database.ProtoReflect.Descriptor instead.

func (*Database) GetDsn added in v0.0.18

func (x *Database) GetDsn() string

func (*Database) GetFailAfterDuration added in v0.0.18

func (x *Database) GetFailAfterDuration() *durationpb.Duration

func (*Database) GetMaxWaitDuration added in v0.0.18

func (x *Database) GetMaxWaitDuration() *durationpb.Duration

func (*Database) ProtoMessage added in v0.0.18

func (*Database) ProtoMessage()

func (*Database) ProtoReflect added in v0.0.18

func (x *Database) ProtoReflect() protoreflect.Message

func (*Database) Reset added in v0.0.18

func (x *Database) Reset()

func (*Database) String added in v0.0.18

func (x *Database) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL