Documentation ¶
Index ¶
- Constants
- Variables
- func Abs(p string) string
- func Cat(arguments ...string) string
- func FloatToFixedPrecisionString(input_num float64, precision int) string
- func FloatToString(input_num float64) string
- func GetHorizonClient(urlString string) horizon.Client
- func GetNewHorizonClient(urlString string) hClient.Client
- func GetStellarNetwork(passphrase string) b.Network
- func IntToString(input_num int64) string
- func IsAlphanumeric(h string) bool
- func IsSafePath(p string) bool
- func Retry(retry_times float64, interval time.Duration, fn func() error) error
- func SetCSP(w http.ResponseWriter)
- func SetCacheControl(w http.ResponseWriter)
- func SetContentType(w http.ResponseWriter)
- func SetHSTS(w http.ResponseWriter)
- func SetOrigin(w http.ResponseWriter)
- func SetPragma(w http.ResponseWriter)
- func SetXCTO(w http.ResponseWriter)
- func SetXXSS(w http.ResponseWriter)
- func Split(address string) (name, domain string, err error)
- func StrPtr(str string) *string
- func ToFixedPrecision(num float64, precision int) float64
- func ValidateHash(h string) bool
Constants ¶
View Source
const ( KillswitchStringLength int = 20 BlocklistApprovedString string = "approved" BlocklistDeniedString string = "denied" HandleIdName string = "PRIVATE_HANDLEID_" DefaultTrustLimit int64 = 100 MASTER_ACCOUNT string = "token" LOCAL_SECRET = "LOCAL" VAULT_SECRET = "VAULT" AWS_SECRET = "AWS" HASHICORP_VAULT_SECRET = "HASHICORP_VAULT" )
View Source
const ( //True and False : string constant for query parameters True string = "true" False string = "false" ISSUING string = "issuing" DEFAULT string = "default" )
View Source
const Separator = "*"
Separator seperates the name and domain portions of an address
Variables ¶
View Source
var ( // ErrInvalidAddress is the error returned when an address is invalid in // such a way that we do not know if the name or domain portion is at fault. ErrInvalidAddress = errors.New("invalid address") // ErrInvalidName is the error returned when an address's name portion is // invalid. ErrInvalidName = errors.New("name part of address is invalid") // ErrInvalidDomain is the error returned when an address's domain portion // is invalid. ErrInvalidDomain = errors.New("domain part of address is invalid") )
View Source
var LOGGER = logging.MustGetLogger("common")
Functions ¶
func FloatToString ¶
func GetHorizonClient ¶
We should use this method only to point to horizon client that we want this way we can use our own standalone horizon client
func GetNewHorizonClient ¶
func GetStellarNetwork ¶
func IntToString ¶
func IsAlphanumeric ¶
func IsSafePath ¶
It is important to use absolute /canonical paths in order to avoid Path Traversal attacks
func Retry ¶
For retrying invoking function until time is up or function successfully return result. Can pass math.Inf(1) as retry_times for infinite retries.
func SetCacheControl ¶
func SetCacheControl(w http.ResponseWriter)
39844: Cacheable HTTPS response (Informational) Setting Cache-control
func SetContentType ¶
func SetContentType(w http.ResponseWriter)
39845: Input returned in response (Reflected) (Low) Setting Pragma
func SetOrigin ¶
func SetOrigin(w http.ResponseWriter)
func SetPragma ¶
func SetPragma(w http.ResponseWriter)
39844: Cacheable HTTPS response (Informational) Setting Pragma
func SetXCTO ¶
func SetXCTO(w http.ResponseWriter)
39842: Missing X-Content-Type-Options Header (Informational) Setting X Content Type Options
func SetXXSS ¶
func SetXXSS(w http.ResponseWriter)
39840: Missing X-XSS-Protection Header (Informational) Setting X-XSS-Protection
func Split ¶
Split takes an address, of the form "name*domain" and provides the constituent elements.
func ToFixedPrecision ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.