client io architecture
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// Package implements "galaxy/connector.Connector" interface with HTTP REST API protocol
|
||||
package http
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type httpConnector struct {
|
||||
ctx context.Context
|
||||
backendURL *url.URL // HTTP REST API Server URL
|
||||
}
|
||||
|
||||
func NewHttpConnector(ctx context.Context, backendURL string) (*httpConnector, error) {
|
||||
u, err := url.Parse(backendURL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
h := &httpConnector{
|
||||
ctx: ctx,
|
||||
backendURL: u,
|
||||
}
|
||||
return h, nil
|
||||
}
|
||||
Reference in New Issue
Block a user