MCPcopy Create free account
hub / github.com/brimdata/super / NewConnectionTo

Function NewConnectionTo

api/client/connection.go:62–72  ·  view source on GitHub ↗

NewConnectionTo creates a new connection with the given useragent string and a base URL derived from the hostURL argument.

(hostURL string)

Source from the content-addressed store, hash-verified

60// NewConnectionTo creates a new connection with the given useragent string
61// and a base URL derived from the hostURL argument.
62func NewConnectionTo(hostURL string) *Connection {
63 defaultHeader := http.Header{
64 "Accept": []string{api.MediaTypeBSUP},
65 "Content-Type": []string{api.MediaTypeBSUP},
66 }
67 return &Connection{
68 client: &http.Client{},
69 defaultHeader: defaultHeader,
70 hostURL: strings.TrimRight(hostURL, "/"),
71 }
72}
73
74// ClientHostURL allows us to print the host in log messages and internal error messages
75func (c *Connection) ClientHostURL() string {

Callers 6

newCoreWithConfigFunction · 0.92
ConnectionMethod · 0.92
RunMethod · 0.92
ConnectFunction · 0.92
TestClientRedirectReplayFunction · 0.85
NewConnectionFunction · 0.85

Calls

no outgoing calls

Tested by 2

newCoreWithConfigFunction · 0.74
TestClientRedirectReplayFunction · 0.68