cockroach

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close(wg *sync.WaitGroup) error

func Cluster

func Cluster() string

func Database

func Database() string

func Host

func Host() string

func MaxConnections added in v0.4.0

func MaxConnections() int32

func MinConnections added in v0.4.0

func MinConnections() int32

func Password

func Password() string

func Port

func Port() string

func SSLMode

func SSLMode() string

func SSLRootCert

func SSLRootCert() string

func SetCluster

func SetCluster(newCluster string)

func SetDatabase

func SetDatabase(newDatabase string)

func SetHost

func SetHost(newHost string)

func SetMaxConnections added in v0.4.0

func SetMaxConnections(newMax int32)

func SetMinConnections added in v0.4.0

func SetMinConnections(newMin int32)

func SetPassword

func SetPassword(newPassword string)

func SetPort

func SetPort(newPort string)

func SetSSLMode

func SetSSLMode(newSSLMode string)

func SetSSLRootCert

func SetSSLRootCert(newSSLRootCert string)

func SetUser

func SetUser(newUser string)

func User

func User() string

Types

type Conn

type Conn struct {
	*pgxpool.Conn
}

func GetConnection

func GetConnection(ctx context.Context) (*Conn, error)

func (*Conn) AddPost

func (c *Conn) AddPost(request models.SendPostRequest) error

TODO Use user model

func (*Conn) Close added in v0.4.0

func (c *Conn) Close(context.Context) error

func (*Conn) FindUser

func (c *Conn) FindUser(filter map[string]string) (models.User, error)

func (*Conn) GetPosts

func (c *Conn) GetPosts(page, num int) ([]models.PostDisplay, error)

func (*Conn) GetPostsSince added in v0.4.0

func (c *Conn) GetPostsSince(max int, since time.Time) ([]models.PostDisplay, int, error)

func (*Conn) GetPublicKey

func (c *Conn) GetPublicKey(email string) (ssh.PublicKey, error)

func (*Conn) RegisterUser

func (c *Conn) RegisterUser(request models.RegisterRequest) error

Jump to

Keyboard shortcuts

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