core

package
v0.0.0-...-4acd792 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PostgresQuery

func PostgresQuery[RowType any](query string, args ...interface{}) ([]RowType, error)

func PostgresQueryJson

func PostgresQueryJson[RowType any](query string, args ...interface{}) ([]byte, error)

func PostgresQueryOne

func PostgresQueryOne[RowType any](query string, args ...interface{}) (*RowType, error)

func PostgresQueryOneJson

func PostgresQueryOneJson[RowType any](query string, args ...interface{}) ([]byte, error)

Types

type Backend

type Backend struct {
	Databases         *Databases
	WSConnections     []*websocket.Conn
	WSConnectionsLock sync.Mutex

	RoundsConfig  *config.RoundsConfig
	CanvasConfig  *config.CanvasConfig
	BackendConfig *config.BackendConfig

	AdminMode bool
}
var ArtPeaceBackend *Backend

func NewBackend

func NewBackend(databases *Databases, roundsConfig *config.RoundsConfig, canvasConfig *config.CanvasConfig, backendConfig *config.BackendConfig, adminMode bool) *Backend

func (*Backend) GetBackendUrl

func (b *Backend) GetBackendUrl() string

func (*Backend) Start

func (b *Backend) Start(port int)

type Databases

type Databases struct {
	DatabaseConfig *config.DatabaseConfig

	Redis    *redis.Client
	Postgres *pgxpool.Pool
}

func NewDatabases

func NewDatabases(databaseConfig *config.DatabaseConfig) *Databases

func (*Databases) Close

func (d *Databases) Close()

Jump to

Keyboard shortcuts

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