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

undefined: GottpSettings #23

Open
tablecell opened this issue Sep 3, 2021 · 0 comments
Open

undefined: GottpSettings #23

tablecell opened this issue Sep 3, 2021 · 0 comments

Comments

@tablecell
Copy link

package main

import (
	"gopkg.in/meson10/gottp.v3"
	"gopkg.in/meson10/gottp.v3/conf"
	"log"
)

type Configurer interface {
	MakeConfig(string)
	GetGottpConfig() *GottpSettings
}
type config struct {
	Custom struct {
		VarOne string
		VarTwo string
	}
	Gottp conf.GottpSettings
}

func (self *config) MakeConfig(configPath string) {
	if configPath != "" {
		conf.MakeConfig(configPath, self)
	}
}
func (self *config) GetGottpConfig() *conf.GottpSettings {
	return &self.Gottp
}

type HelloMessage struct {
	gottp.BaseHandler
}

func (self *HelloMessage) Get(req *gottp.Request) {
	req.Write("hello world")
}

var settings config

func main() {

	gottp.NewUrl("hello", "/hello/\\w{3,5}/?$", new(handlers.HelloMessage))

	gottp.MakeServer(&settings)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant