Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultAddress = ":0" DefaultName = "go.ebrick.server" DefaultVersion = "latest" )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Options)
func WithAddress ¶
func WithAdvertise ¶
func WithContext ¶
func WithRouter ¶
func WithVersion ¶
type Options ¶
type Options struct {
// Other options for implementations of the interface
// can be stored in a context
Context context.Context
// The router for requests
Router Router
Name string
Id string
Version string
Advertise string
Address string
}
func NewOptions ¶
type Server ¶
type Server interface {
// Initialize options
Init(...Option) error
// Retrieve the options
Options() Options
// Start the server
Start() error
// Stop the server
Stop() error
}
Server defines the interface for a server with methods to initialize, start, and stop the server, as well as retrieve its options.
Click to show internal directories.
Click to hide internal directories.