Skip to content
/ snout Public
forked from chiguirez/snout

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

License

Notifications You must be signed in to change notification settings

hosseio/snout

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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{
  //
  // ..  
  //
}

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%