Skip to content

Latest commit

 

History

History
40 lines (34 loc) · 709 Bytes

README.md

File metadata and controls

40 lines (34 loc) · 709 Bytes

snout

Entry point or bootstrap for MS built on GO, it handles Signalling, loggers and config vars and envVars

Example

func main() {
	kernel := snout.Kernel{
		RunE: Run,
	}
	kernelBootstrap := kernel.Bootstrap(
		"agent",
		&Config{},
	)
	if err := kernelBootstrap.Initialize(); err != nil {
		if err != context.Canceled {
			panic(err)
		}
	}
}

type Config struct {
	Kafka struct {
		BrokerAddress string `mapstructure:"broker_address"`
		ConsumerGroup string `mapstructure:"consumer_group"`
		Topic         string `mapstructure:"topic"`
	} `mapstructure:"kafka"`
	App struct {
		//...
	} `mapstructure:"app"`
}

func Run(ctx context.Context, cfg Config) error{
  //
  // ..  
  //
}