clover

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

README ΒΆ

πŸ€ Clover

Build Status codecov

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

Clover takes care of routing RapidPro/TextIt 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