Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chiguirez/snout

Repository files navigation

Bootstrap package for building Services in Go, Handle Signaling and Config coming from env, yaml or json files as well as envVars

Example

func main() {
	kernel := snout.Kernel[Config]{
		RunE: Run,
	}
	kernelBootstrap := kernel.Bootstrap(
	 context.Background(),
	)
	if err := kernelBootstrap.Initialize(); err != nil {
		if err != context.Canceled {
			panic(err)
		}
	}
}
type Config struct {
	Kafka struct {
		BrokerAddress string `snout:"broker_address"`
		ConsumerGroup string `snout:"consumer_group"`
		Topic string `snout:"topic"`
	} `snout:"kafka"`
	App struct {
		//...
	} `snout:"app"`
}
func Run(ctx context.Context, cfg Config) error{
 //
 // .. 
 //
}

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /