matrix

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package matrix allows to check the status synapse matrix server.

Index

Constants

View Source
const StatusOK = "OK"

StatusOK is the value that synapse reports as health status when everything is good.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, serverName string, addr string) error

Connect dials a tcp connection to the given ip and attempts to establish a TLSv1.3 session over it. It validates the servers certificate using the host CA set and the server name using serverName. It then performs a HTTP GET on the path /health. If the request is answered with HTML status code 200 and the response payload is equal to the StatusOK value, the method returns nil.

func ResolveV4

func ResolveV4(ctx context.Context, domain string) (string, string, error)

ResolveV4 resolves the IPv4 address of the matrix server responsible for the given domain. Is does so by searching for the DNS SRV _matrix._tcp.$domain and returning the first IPv4 address.

func ResolveV6

func ResolveV6(ctx context.Context, domain string) (string, string, error)

ResolveV6 resolves the IPv6 address of the matrix server responsible for the given domain. Is does so by searching for the DNS SRV _matrix._tcp.$domain and returning the first IPv6 address.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL