state

package
v0.0.0-...-8e2c34a Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package state manages all external state conns

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	Level                                env.Level
	Master                               *sql.DB
	Replicas                             []*sql.DB
	Key                                  []byte
	SigningKey                           []byte
	Argon2Cfg                            argon2.Config
	RootOrg, RootUser, RootUserAPISecret string
	L                                    *zap.Logger
}

Instance is a single set of conns

func New

func New(level env.Level) (*Instance, error)

New creates a new instance for the given level

func (*Instance) Close

func (s *Instance) Close() error

Close should be deferred in the main context

func (*Instance) RandomReplica

func (s *Instance) RandomReplica() *sql.DB

RandomReplica selects a random replica

Jump to

Keyboard shortcuts

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