lint: fix all major issues

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-02-14 16:16:01 +03:00
parent a11dd00174
commit 4ec4c277b7
65 changed files with 302 additions and 146 deletions

View File

@@ -11,24 +11,23 @@ import (
"github.com/unistack-org/micro/v3/resolver"
)
// Resolver is a HTTP network resolver
type Resolver struct {
// If not set, defaults to http
// HTTPResolver is a HTTP network resolver
type HTTPResolver struct {
// Proto if not set, defaults to http
Proto string
// Path sets the path to lookup. Defaults to /network
Path string
// Host url to use for the query
Host string
}
// Response contains resolver.Record
type Response struct {
Nodes []*resolver.Record `json:"nodes,omitempty"`
}
// Resolve assumes ID is a domain which can be converted to a http://name/network request
func (r *Resolver) Resolve(name string) ([]*resolver.Record, error) {
func (r *HTTPResolver) Resolve(name string) ([]*resolver.Record, error) {
proto := "http"
host := "localhost:8080"
path := "/network/nodes"