Grav Instance Options
When calling grav.New, you can optionally include some options:
1
// UseLogger allows a custom logger to be used
2
func UseLogger(logger *vlog.Logger) OptionsModifier
3
4
// UseTransport sets the transport plugin to be used.
5
func UseTransport(transport Transport) OptionsModifier
6
7
// UseEndpoint sets the endpoint settings for the instance to broadcast for discovery
8
// Pass empty strings for either if you would like to keep the defaults (8080 and /meta/message)
9
func UseEndpoint(port, uri string) OptionsModifier
10
11
// UseDiscovery sets the discovery plugin to be used
12
func UseDiscovery(discovery Discovery) OptionsModifier
Copied!
If no options are passed, then the default options are used:
1
Logger: vlog.Default(),
2
Port: "8080",
3
URI: "/meta/message",
4
Transport: nil,
5
Discovery: nil,
Copied!
Last modified 1yr ago
Copy link