data

package
v5.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT 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 added in v5.6.0

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 added in v5.6.0

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