func (cons *HTTP) Configure(conf core.PluginConfigReader) {
	if cons.htpasswd != "" {
		if _, fileErr := os.Stat(cons.htpasswd); os.IsNotExist(fileErr) {
			conf.Errors.Pushf("htpasswd file does not exist: %s", cons.htpasswd)
			cons.htpasswd = ""
		}
		cons.secrets = auth.HtpasswdFileProvider(cons.htpasswd)
	}
	certificateFile := conf.GetString("Certificate", "")
	keyFile := conf.GetString("PrivateKey", "")
	if certificateFile != "" || keyFile != "" {
		if certificateFile == "" || keyFile == "" {
			conf.Errors.Pushf("There must always be a certificate and a private key or none of both")
		} else {
			cons.certificate = new(tls.Config)
			cons.certificate.NextProtos = []string{"http/1.1"}
			keypair, err := tls.LoadX509KeyPair(certificateFile, keyFile)
			if !conf.Errors.Push(err) {
				cons.certificate.Certificates = []tls.Certificate{keypair}
			}
		}
	}
}
Configure initializes this consumer with values from a plugin config.
package consumer
import (
	"bytes"
	"crypto/tls"
	"io/ioutil"
	"net/http"
	"os"
	"sync"
	"time"
	"gollum/core"
	auth "github.com/abbot/go-http-auth"
	"github.com/trivago/tgo/tnet"
)
type HTTP struct {
	core.SimpleConsumer `gollumdoc:"embed_type"`
	address             string        `config:"Address" default:":80"`
	readTimeout         time.Duration `config:"ReadTimeoutSec" default:"3" metric:"sec"`
	withHeaders         bool          `config:"WithHeaders" default:"true"`
	htpasswd            string        `config:"Htpasswd"`
	basicRealm          string        `config:"BasicRealm"`
	secrets             auth.SecretProvider
	listen              *tnet.StopListener
	certificate         *tls.Config
}
func init() {
	core.TypeRegistry.Register(HTTP{})
}