Documentation
¶
Overview ¶
Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0
Index ¶
- Variables
- type URI
- func (u URI) Equals(other *URI) bool
- func (u *URI) HostPort() string
- func (u *URI) MarshalJSON() ([]byte, error)
- func (u *URI) Normalize() string
- func (u *URI) Path(path string) string
- func (u *URI) Set(value string) error
- func (u *URI) SetHost(host string) error
- func (u *URI) SetPort(port uint16)
- func (u *URI) SetScheme(scheme string) error
- func (u URI) String() string
- func (u URI) Translate(nat map[URI]URI) URI
- func (u URI) Type() string
- func (u *URI) URL() url.URL
- func (u *URI) UnmarshalJSON(b []byte) error
- type URIs
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidAddress = errors.New("invalid address") ErrInvalidSchema = errors.New("invalid schema") )
Functions ¶
This section is empty.
Types ¶
type URI ¶
type URI struct { Scheme string `json:"scheme"` Host string `json:"host"` Port uint16 `json:"port"` }
URI represents a Pilosa URI. A Pilosa URI consists of three parts: 1) Scheme: Protocol of the URI. Default: http. 2) Host: Hostname or IP URI. Default: localhost. IPv6 addresses should be written in brackets, e.g., `[fd42:4201:f86b:7e09:216:3eff:fefa:ed80]`. 3) Port: Port of the URI. Default: 10101.
All parts of the URI are optional. The following are equivalent:
http://localhost:10101 http://localhost http://:10101 localhost:10101 localhost :10101
func NewURIFromAddress ¶
NewURIFromAddress parses the passed address and returns a URI.
func NewURIFromHostPort ¶
NewURIFromHostPort returns a URI with specified host and port.
func (*URI) MarshalJSON ¶
MarshalJSON marshals URI into a JSON-encoded byte slice.
func (*URI) UnmarshalJSON ¶
UnmarshalJSON unmarshals a byte slice to a URI.