locations

package module
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: GPL-2.0 Imports: 19 Imported by: 0

README

bottin/locations

Prototype d'application de gestion de locations au Centre Multi-Service de l'AGECEM.

État du projet

Le projet est en pré-sortie, incomplet, et insécure. Ne pas utiliser en production.

Démarrage rapide

Pour tester le stack applicatif complet localement, les dépendances suivantes sont requises:

  • make
  • docker
  • docker-compose

Le déploiement de développement typique nécessite la création d'un fichier .env (non-accessible publiquement) avec le contenu suivant:

# .env
BOTTINLOCATIONS_SERVER_API_POSTGRES_DATABASE=bottinlocations
BOTTINLOCATIONS_SERVER_API_POSTGRES_PASSWORD=bottinlocations
BOTTINLOCATIONS_SERVER_API_POSTGRES_USER=bottinlocations
BOTTIN_SERVER_API_POSTGRES_DATABASE=bottin
BOTTIN_SERVER_API_POSTGRES_PASSWORD=bottin
BOTTIN_SERVER_API_POSTGRES_USER=bottin

note: les valeur doivent impérativement être changées en production.

Pour build et démarrer les containers par docker-compose:

make deploy

Pour voir les autres options:

make help

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultServer

func DefaultServer(ctx context.Context, keyPairs ...tls.Certificate) (*http.Server, error)

DefaultServer returns a pointer to a http.Server with inserted tls keyPairs, or any error encountered.

If no keyPairs are provided, generates a self-signed keyPair and activates InsecureSkipVerify.

func DefaultServerWithConfig added in v0.8.0

func DefaultServerWithConfig(ctx context.Context, cfg *Config, keyPairs ...tls.Certificate) (*http.Server, error)

func RegisterFlags added in v0.8.0

func RegisterFlags(flagSet *pflag.FlagSet) error

Types

type Config added in v0.8.0

type Config struct {
	Client struct{}

	Server struct {
		API struct {
			BearerToken string
			Host        string
			Port        int
		}
		Bottin bottin.APIClientConfig
		DB     struct {
			Database string
			Host     string
			Password string
			Port     int
			SSLMode  string
			User     string
		}
		TLS struct {
			// Cert is a TLS certificate, or path to a file containing one or more.
			// Can be skipped if EnableAutoSelfSigned is true
			Cert string

			EnableAutoSelfSigned bool

			// Key is a TLS private key, or path to a file containing one or more.
			// Can be skipped if EnableAutoSelfSigned is true
			Key string
		}
		UI struct {
			BasicAuth struct {
				Password string
				User     string
			}
			Host string
			Port int
		}
	}
}

func NewConfigFromViper added in v0.8.0

func NewConfigFromViper() (cfg *Config, err error)

type HTTPAPIClient added in v0.6.0

type HTTPAPIClient struct {
	Caller *voki.Voki
}

func NewHTTPAPIClient added in v0.6.0

func NewHTTPAPIClient(client *http.Client, host string, key string, port int, protocol string) *HTTPAPIClient

func (HTTPAPIClient) ReadHelloWorld added in v0.6.0

func (c HTTPAPIClient) ReadHelloWorld() (code int, body []byte, err error)

type PostgresClient added in v0.7.0

type PostgresClient struct {
	Pool *pgxpool.Pool
}

func (PostgresClient) Init added in v0.7.0

func (c PostgresClient) Init(ctx context.Context) error

Directories

Path Synopsis
cmd
locations command

Jump to

Keyboard shortcuts

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