discoverability

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

See: https://gitlab.com/OpenVASP/travel-rule-protocol/-/blob/master/extensions/discoverability.md

Index

Constants

View Source
const (
	VersionEndpoint    = "/version"
	UptimeEndpoint     = "/uptime"
	ExtensionsEndpoint = "/extensions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Version(ctx context.Context, address string) (*Version, error)
	Uptime(ctx context.Context, address string) (Uptime, error)
	Extensions(ctx context.Context, address string) (*Extensions, error)
}

Client defines the service interface for interacting with the TRP discoverability endpoints.

type Extensions

type Extensions struct {
	Required  []string `json:"required,omitempty"`
	Supported []string `json:"supported,omitempty"`
}

Extensions is returned on the extensions discoverability endpoint.

type Uptime

type Uptime time.Duration

Uptime is returned on the uptime discoverability endpoint.

func UptimeSince

func UptimeSince(start time.Time) Uptime

Get the uptime since the given start timestamp.

func (Uptime) MarshalText

func (u Uptime) MarshalText() (text []byte, err error)

Marshals the uptime into a base 10 integer describing the number of seconds of the duration.

func (*Uptime) UnmarshalText

func (u *Uptime) UnmarshalText(text []byte) (err error)

Unmarshals the uptime from a base 10 integer describing the number of seconds up.

type Version

type Version struct {
	Version string `json:"version,omitempty"`
	Vendor  string `json:"vendor,omitempty"`
}

Version returned on the version discoverability endpoint.

Jump to

Keyboard shortcuts

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