mirror of
https://github.com/hanzo-ds/native.git
synced 2026-10-30 20:00:34 +00:00
proto.Name is sent in ClientHello and lands in the server's system.query_log, so it is wire visible; it now reads datastore/native and is covered by a test. Verified against the live server: the handshake succeeds and the new name appears in query_log. goimports' local-prefixes still named the upstream module, so it was not grouping this module's own imports. Doc comments, the deprecated-error markers in proto/error_codes.go and the package prose are swept. Dead references are removed rather than repointed: go-faster.org/docs/clickhouse and the mangled Datastore/clickhouse-cpp link both 404, and the list of other vendors' clients does not belong here. Four things deliberately keep the vendor name, and CI records why: LICENSE and AUTHORS are the copyright notices Apache-2.0 requires; db.system in query.go is an OpenTelemetry enum whose registered value for this DBMS is fixed by the specification, so emitting anything else would be non-conformant; and README names clickhouse-local, which is genuinely the binary our own server image ships. Numeric error codes and protocol revision constants are untouched.
26 lines
511 B
Go
26 lines
511 B
Go
package proto
|
|
|
|
import (
|
|
"net/netip"
|
|
)
|
|
|
|
// IPv6 represents IPv6 address.
|
|
//
|
|
// Same as FixedString(16) internally in Datastore.
|
|
type IPv6 [16]byte
|
|
|
|
func (v IPv6) String() string {
|
|
return v.ToIP().String()
|
|
}
|
|
|
|
// ToIP represents IPv6 as netip.IP.
|
|
func (v IPv6) ToIP() netip.Addr {
|
|
return netip.AddrFrom16(v)
|
|
}
|
|
|
|
// ToIPv6 represents ip as IPv6.
|
|
func ToIPv6(ip netip.Addr) IPv6 { return ip.As16() }
|
|
|
|
func binIPv6(b []byte) IPv6 { return *(*[16]byte)(b) }
|
|
func binPutIPv6(b []byte, v IPv6) { copy(b, v[:]) }
|