commit 5ed1673d40847153e01d5c83efe6fc373d0062da parent 84c4dce194d9fbcc29aabd63a192ba6cddb12274 Author: Martin Schanzenbach <schanzen@gnunet.org> Date: Sat, 13 Jan 2024 12:48:25 +0100 Add struct documentation and references Diffstat:
| M | pkg/rest/gnsregistrar.go | | | 45 | ++++++++++++++++++++++++++++++++++++++++++--- |
1 file changed, 42 insertions(+), 3 deletions(-)
diff --git a/pkg/rest/gnsregistrar.go b/pkg/rest/gnsregistrar.go @@ -41,39 +41,78 @@ import ( talerutil "github.com/schanzen/taler-go/pkg/util" ) -type RegistrationMetadata struct { +// This is metadata stored in the namestore next to a registered zone key. +// It is always stored in a private metadata record and holds registration information such +// as payment status and expiration. +type RegistrationMetadata struct { + // The expiration in GNS-compatible 64-bit microseconds epoch. Expiration uint64 `json:"expiration"` - Paid bool `json:"paid"` + + // Indication if this registration is already paid and active. + Paid bool `json:"paid"` + + // The unique order identifier (as received through https://docs.taler.net/core/api-merchant.html). OrderID string `json:"order_id"` + + // The unique registration identifier used as token for registration management by customer. RegistrationID string `json:"registration_id"` + + // The payment deadline. FIXME this may also be part of the order somehow in the Taler API. NeedsPaymentUntil time.Time `json:"needs_payment_until"` } +// See https://docs.gnunet.org/latest/developers/rest-api/identity.html type IdentityInfo struct { + // Base32-encoded GNS zone key Pubkey string `json:"pubkey"` + + // The name of the zone/identity Name string `json:"name"` } - +// See https://gana.gnunet.org/gnunet-error-codes/gnunet_error_codes.html type GnunetError struct { + // Error description Description string `json:"error"` + + // Error code Code uint32 `json:"error_code"` } +// See https://docs.gnunet.org/latest/developers/rest-api/namestore.html type RecordData struct { + // The string representation of the record data value, e.g. "1.2.3.4" for an A record Value string `json:"value"` + + // The string representation of the record type, e.g. "A" for an IPv4 address RecordType string `json:"record_type"` + + // The relative expiration time, in microseconds. Set if is_relative_expiration: true RelativeExpiration uint64 `json:"relative_expiration"` + + // Whether or not this is a private record IsPrivate bool `json:"is_private"` + + // Whether or not the expiration time is relative (else absolute) IsRelativeExpiration bool `json:"is_relative_expiration"` + + // Whether or not this is a supplemental record IsSupplemental bool `json:"is_supplemental"` + + // Whether or not this is a shadow record IsShadow bool `json:"is_shadow"` + + // Whether or not this is a maintenance record IsMaintenance bool `json:"is_maintenance"` } +// See https://docs.gnunet.org/latest/developers/rest-api/namestore.html type NamestoreRecord struct { + // Name of the record set RecordName string `json:"record_name"` + + // The record set Records []RecordData `json:"data"` }