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

Need help incorporating it in application #45

Closed
driftavalii opened this issue Sep 22, 2019 · 1 comment
Closed

Need help incorporating it in application #45

driftavalii opened this issue Sep 22, 2019 · 1 comment
Labels
question Further information is requested

Comments

@driftavalii
Copy link

What is your question?

I have a type the following code but finding it hard to integrate certmagic

type Server struct {
  Port        int
  Addr        string
  HTTPServer  *http.Server
}

func (s *Server) Start(){
  s.HTTPServer.ListenAndServe()
}

I set values for http.Server later on with (addr and handler) so I can just call http.ListenAndServe(), however certmagic.HTTPS() seems to require two arguments. Am I able to call certmagic and use the default addr, handler etc?

What have you already tried?

I tried just dropping certmagic.HTTPS([]string{"example.com"}) but this throws an error. There doesn't seem to any other high level call to just drop in.

Include any other information or discussion.

Bonus: What do you use this package for, and does it help you?

Hoping to use it for an API

@driftavalii driftavalii added the question Further information is requested label Sep 22, 2019
@mholt
Copy link
Member

mholt commented Sep 22, 2019

You need to pass in your http.Handler; whatever type of yours implements the http.Handler interface.

@mholt mholt closed this as completed Sep 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants