Files
galaxy-game/connector/http/http.go
T
2026-03-12 19:45:46 +03:00

25 lines
482 B
Go

// 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
}