Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Server accept a config struct #7

Open
dchest opened this issue Feb 1, 2015 · 0 comments
Open

Make Server accept a config struct #7

dchest opened this issue Feb 1, 2015 · 0 comments

Comments

@dchest
Copy link
Owner

dchest commented Feb 1, 2015

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
@dchest dchest added this to the v2 milestone Jun 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant