Documentation
¶
Index ¶
- func HealthGet(w http.ResponseWriter, r *http.Request)
- type API
- type Instance
- func (i *Instance) AddAPI(w http.ResponseWriter, r *http.Request)
- func (i *Instance) AddSeed(w http.ResponseWriter, r *http.Request)
- func (i *Instance) GetInfoAPI(w http.ResponseWriter, r *http.Request)
- func (i *Instance) GetPetname(w http.ResponseWriter, r *http.Request)
- func (i *Instance) ReloadAPI(w http.ResponseWriter, r *http.Request)
- func (i *Instance) RemoveSeed(w http.ResponseWriter, r *http.Request)
- func (i *Instance) SetupAPI(name string, lock bool, template string, separator string) bool
- func (i *Instance) SetupRouter()
- func (i *Instance) Start(port int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
Name string `json:"name"`
Lock bool `json:"lock"`
Token []string `json:"token,omitempty"`
Generator *generator.Generator `json:"generator,omitempty"`
}
API represents an API access point
type Instance ¶
Instance is a structure that stores the router
func (*Instance) AddAPI ¶ added in v0.1.0
func (i *Instance) AddAPI(w http.ResponseWriter, r *http.Request)
AddAPI adds an API endpoint
func (*Instance) AddSeed ¶ added in v0.1.0
func (i *Instance) AddSeed(w http.ResponseWriter, r *http.Request)
AddSeed adds a seed to a specific api endpoint note that duplicate seed is explicitely allowed in order to allow for increasing odds as well as to allow some names to pop up twice
func (*Instance) GetInfoAPI ¶ added in v0.1.0
func (i *Instance) GetInfoAPI(w http.ResponseWriter, r *http.Request)
GetInfoAPI returns informations about a specific API
func (*Instance) GetPetname ¶ added in v0.1.0
func (i *Instance) GetPetname(w http.ResponseWriter, r *http.Request)
GetPetname returns petname when queried
func (*Instance) ReloadAPI ¶ added in v0.1.0
func (i *Instance) ReloadAPI(w http.ResponseWriter, r *http.Request)
ReloadAPI cleans the Used binary tree for a specific API
func (*Instance) RemoveSeed ¶ added in v0.1.0
func (i *Instance) RemoveSeed(w http.ResponseWriter, r *http.Request)
RemoveSeed removes a seed to a specific api endpoint
func (*Instance) SetupRouter ¶
func (i *Instance) SetupRouter()
SetupRouter generates the initial router configurations for the petname API server
Click to show internal directories.
Click to hide internal directories.