You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Server, accepts imgWidth and imgHeight. I'd like to change it to accept a configuration struct to make it easier to expand it without API change:
type ServerConfig struct {
ImgWidth int
ImgHeight int
}
func Server(config *ServerConfig) http.Handler
Another idea is to make top-level functions methods on config (renamed Server or something):
type Server struct {
ImgWidth int
ImgHeight int
Store Store
CollectNum int
Expiration time.Time
}
func (c *Server) Handler() http.Handler
The text was updated successfully, but these errors were encountered:
Currently,
Server
, acceptsimgWidth
andimgHeight
. I'd like to change it to accept a configuration struct to make it easier to expand it without API change:Another idea is to make top-level functions methods on config (renamed
Server
or something):The text was updated successfully, but these errors were encountered: