data

package
v6.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

type ApiClient struct {
	Voki *voki.Voki
}

func NewApiClient

func NewApiClient(client *http.Client, key, host, protocol string, port int) *ApiClient

func NewApiClientFromViper

func NewApiClientFromViper(client *http.Client) *ApiClient

func (*ApiClient) GetHealth

func (a *ApiClient) GetHealth() (string, error)

GetHealth allows checking for API server health

func (*ApiClient) GetMembre

func (a *ApiClient) GetMembre(membreID string) (models.Membre, error)

func (*ApiClient) ListMembres

func (a *ApiClient) ListMembres() (r responses.ListMembresResponse, err error)

type DataClient

type DataClient struct {
	PostgresConnection PostgresConnection
	DB                 sqlx.DB
}

DataClient is a postgres client based on sqlx

func NewDataClient

func NewDataClient(connection PostgresConnection) (*DataClient, error)

func NewDataClientFromViper

func NewDataClientFromViper() (*DataClient, error)

func (*DataClient) GetMembre

func (d *DataClient) GetMembre(membreID string) (models.Membre, error)

func (*DataClient) GetMembres

func (d *DataClient) GetMembres() (membres []models.Membre, err error)

func (*DataClient) InsertMembres

func (d *DataClient) InsertMembres(membres []models.Membre) (int64, error)

InsertMembres inserts a slice of Membre into a database, returning the amount inserted and any error encountered

func (*DataClient) InsertProgrammes

func (d *DataClient) InsertProgrammes(programmes []models.Programme) (int64, error)

func (*DataClient) Seed

func (d *DataClient) Seed() (int64, error)

func (*DataClient) UpdateMembreName

func (d *DataClient) UpdateMembreName(membreID, newName string) (int64, error)

type PostgresConnection

type PostgresConnection struct {
	User     string
	Password string
	Database string
	Host     string
	Port     int
	SSL      bool
}

Jump to

Keyboard shortcuts

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