Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidPublicAddressFormat is returned when a public address contains // characters that are not valid hexadecimal digits (0-9, a-f, A-F). ErrInvalidPublicAddressFormat = errors.New("public address must be a valid hex string") // ErrInvalidPublicAddressLength is returned when a public address is not // exactly 64 characters long. ErrInvalidPublicAddressLength = errors.New("public address must be 64 characters long") )
Functions ¶
func EncryptRequestSourceWithWalletID ¶
func EncryptRequestSourceWithWalletID(requestSource models.BridgeRequestSource, walletID string) (string, error)
EncryptRequestSourceWithWalletID encrypts the request source metadata using the wallet's Curve25519 public key
func ExtractOrigin ¶
func GenerateSelfSignedCertificate ¶
GenerateSelfSignedCertificate generates a self-signed X.509 certificate and private key
Types ¶
type HttpRes ¶
type PublicAddress ¶
type PublicAddress string
PublicAddress represents a 64-character hexadecimal public address. It must contain only valid hex characters (0-9, a-f, A-F) and be exactly 64 characters in length.
func NewPublicAddressFromString ¶
func NewPublicAddressFromString(a string) (PublicAddress, error)
NewPublicAddressFromString creates a new PublicAddress from a string. The input string is trimmed of leading and trailing whitespace for validation, but the original string (with whitespace) is returned if valid. It returns an error if the address is invalid (wrong length or contains non-hexadecimal characters).
func (PublicAddress) String ¶
func (a PublicAddress) String() string
String returns the string representation of the PublicAddress.
func (PublicAddress) Validate ¶
func (a PublicAddress) Validate() error
Validate checks if the PublicAddress is valid. It returns ErrInvalidPublicAddressLength if the address is not exactly 64 characters long, or ErrInvalidPublicAddressFormat if it contains non-hexadecimal characters.
type RealIPExtractor ¶
type RealIPExtractor struct {
// contains filtered or unexported fields
}
func NewRealIPExtractor ¶
func NewRealIPExtractor(trustedRanges []string) (*RealIPExtractor, error)
NewRealIPExtractor creates a new realIPExtractor with the given trusted ranges.