clover

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: AGPL-3.0 Imports: 21 Imported by: 0

README

rp-clover

Build Status codecov Go Report Card

Router for incoming messages to RapidPro, takes care of changing contact affinity based on keywords and routing incoming messages based on that affinity.

Clover takes care of routing RapidPro messages based on membership.

Usage of clover:
  -address string
    	the address clover will listen on (default "localhost")
  -db string
    	the connection string for our database (default "postgres://localhost/clover_test?sslmode=disable")
  -debug-conf
    	print where config values are coming from
  -help
    	print usage information
  -log-level string
    	the log level, one of error, warn, info, debug (default "info")
  -password string
    	the password for the admin user (default "sesame123")
  -port int
    	the port clover will listen on (default 8081)
  -sentry-dsn string
    	the sentry configuration to log errors to, if any
  -version string
    	the version being run (default "Dev")

Environment variables:
                              CLOVER_ADDRESS - string
                                   CLOVER_DB - string
                            CLOVER_LOG_LEVEL - string
                             CLOVER_PASSWORD - string
                                 CLOVER_PORT - int
                           CLOVER_SENTRY_DSN - string
                              CLOVER_VERSION - string

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB        string `help:"the connection string for our database"`
	LogLevel  string `help:"the log level, one of error, warn, info, debug"`
	SentryDSN string `help:"the sentry configuration to log errors to, if any"`
	Version   string `help:"the version being run"`
	Password  string `help:"the password for the admin user"`
	Address   string `help:"the address clover will listen on"`
	Port      int    `help:"the port clover will listen on"`
}

Config is our top level configuration object

func NewConfig

func NewConfig() *Config

NewConfig returns a new default configuration object

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a clover server, which handles incoming handle requests and configuration updates

func NewServer

func NewServer(config *Config, fs http.FileSystem) *Server

NewServer creates a new clover server

func (*Server) Start

func (s *Server) Start() error

Start starts our clover server, returning any errors encountered

func (*Server) Stop

func (s *Server) Stop() error

Stop stops our clover server, returning any errors encountered

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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