Categorygithub.com/superlink-me/superlink-api-go-client
repositorypackage
0.5.0
Repository: https://github.com/superlink-me/superlink-api-go-client.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Go API client for superlink

API for Superlink

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: v0.5.0
  • Package version: v0.5.0
  • Generator version: 7.5.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://superlink.me/about#contact-us

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import superlink "github.com/superlink-me/superlink-api-go-client"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value superlink.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), superlink.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value superlink.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), superlink.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using superlink.ContextOperationServerIndices and superlink.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), superlink.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), superlink.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.superlink.me

ClassMethodHTTP requestDescription
AdminAPIAdminCreateAccessTokenPost /v1/admin/access-tokenCreates an admin token
AdminAPIAdminDeleteAccessTokenDelete /v1/admin/access-tokenDeletes an access token
AdminAPIAdminListAccessTokensGet /v1/admin/access-tokenLists access tokens
AdminAPIAdminListPartnersGet /v1/admin/partnerLists partners
AdminAPIAdminPartnerCreatePost /v1/admin/partnerCreates a partner
AdminAPIHnsTldRegisterPost /v1/admin/hns/tld/registerHNSTLDRegister registers a Handshake TLD
AdminAPIRemoveReverseResolutionAddressDelete /v1/admin/reverseRemoves a reverse resolution address from a domain
AdminAPISetReverseResolutionAddressPost /v1/admin/reverseAssigns an address to a domain for reverse resolution
DefaultAPIHealthCheckGet /v1/healthChecks the health of the API
DomainInfoAPIGetAllDomainsGet /v1/domainReturns all the domains owned by a given ownerAddress
HnsAPIHnsDomainAvailableGet /v1/hns/tld/{tld}/sld/{sld}/availablechecks if a handshake domain is available to mint
HnsAPIHnsDomainCreatePost /v1/hns/tld/{tld}/sld/mintHNSCreateDomain creates a handshake domain
HnsAPIHnsDomainCreateSigPost /v1/hns/tld/{tld}/sld/mint-with-sigcreates a handshake domain authenticated by a signed message
HnsAPIHnsDomainDeleteDelete /v1/hns/tld/{tld}/sld/{sld}deletes a handshake domain
HnsAPIHnsTldCheckClaimedGet /v1/hns/tld/{tld}/check-if-claimed/{address}tests if the wallet has already claimed a domain for this TLD.
HnsAPIHnsTldValidateGet /v1/hns/tld/{tld}/validateHNSTLDValidation tests if the TLD blockchain DNS records are valid.
LoginAPILoginWithLinkGet /v1/login/link/{loginToken}Login via a magic link
LoginAPILoginWithWalletPost /v1/login/wallet/{ownerAddress}Login with a valid wallet
LoginAPISendLoginEmailPost /v1/login/email/{emailAddress}Sends the e-mail that contains the magic link to login a specfic user
MarketAPIMarketCryptoEstimateGet /v1/market/crypto/estimateCryptoEstimate returns the estimated conversion rates for supported crypto payment options
MarketAPIMarketCryptoPurchasePost /v1/market/crypto/purchaseCryptoPurchase returns the payment details required for crypto payment
MarketAPIMarketOrderGet /v1/market/order/{orderID}Returns order information
MarketAPIMarketPurchasePost /v1/market/purchasePurchase returns the payment details required by Stripe
MarketAPIMarketSearchPost /v1/market/searchReturns market listings
MarketAPIMarketSuggestionPost /v1/market/suggestReturns market listings for suggestions
NftAPIGetTokenImageByDomainGet /v1/card-image/{domain}.svgReturns a SVG image for a Superlink NFT
NftAPIGetTokenMetadataByDomainGet /v1/metadata/{domain}Returns metadata usually associated with NFTs uri
PartnerAPICreateAccessTokenPost /v1/partner/access-tokenCreates an admin token for a partner
PartnerAPIDeleteAccessTokenDelete /v1/partner/access-tokenDeletes an access token
PartnerAPIListAccessTokensGet /v1/partner/access-tokenLists access tokens for a partner
PartnerAPIPartnerPurchasesGet /v1/partner/purchasesReturns a list of all purchases
ProveAPIGetEthWalletMessageGet /v1/prove/wallet/eth/{ownerAddress}Get message which should be signed by an eth wallet as proof of ownership
ResolutionAPIResolveDataByAddressGet /v1/reverse/{address}Resolves wallets and DNS records for an address
ResolutionAPIResolveDataByDomainGet /v1/resolve/{domain}Resolves wallets and DNS records for a domain
SubdomainAPIParentdomainPurchasePost /v1/parentdomains/{parentDomain}/buyPurchases and sets up a parent domain for use with ens subdomains
SubdomainAPIParentdomainSearchGet /v1/parentdomains/{parentDomain}/searchReturns a list of available parent-domains provided the preferred parent ddomain
SubdomainAPIParentdomainValidationGet /v1/parentdomains/{parentDomain}Validates if parent domain is correctly configured for use with ens subdomains
SubdomainAPISubdomainAvailableGet /v1/parentdomains/{parentDomain}/subdomains/{subDomainName}Returns subdomain availability
SubdomainAPISubdomainClaimedGet /v1/parentdomains/{parentDomain}/claimed/{ethAddress}Returns subdomain availability
SubdomainAPISubdomainInvalidateClaimRateLimitDelete /v1/parentdomains/{parentDomain}/invalidate-claim-rate-limitInvalidates the claim rate limit for the current IP
SubdomainAPISubdomainListGet /v1/parentdomains/{parentDomain}/listPaginates over all subdomains in descending order of the creation date
SubdomainAPISubdomainMintPost /v1/parentdomains/{parentDomain}/subdomains/{subDomainName}Creates a subdomain for provided parentdomain
SubdomainAPISubdomainMintSigPost /v1/parentdomains/{parentDomain}/subdomains/{subDomainName}/mint-with-sigCreates a subdomain for provided parentdomain with signature
SubdomainAPISubdomainPerDayGet /v1/parentdomains/{parentDomain}/per-dayPaginates over per-day aggregated counts for subdomains created given a parentdomain
SubdomainAPISubdomainResolveGet /v1/parentdomains/{parentDomain}/subdomains/{subDomainName}/resolveReturns resolution of a provided subdomain
SubdomainAPISubdomainReverseResolveGet /v1/parentdomains/{parentDomain}/addresses/{ethAddress}/reverse-resolveReturns reverse-resolution of a provided eth address limited to provided parentdomain
SubdomainAPISubdomainRevokeDelete /v1/parentdomains/{parentDomain}/subdomains/{subDomainName}Deletes a subdomain for provided parentdomain (Omnipotent)
SubdomainAPISubdomainTotalGet /v1/parentdomains/{parentDomain}/totalReturns the total number of subdomains registered to parentdomain

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		superlink.ContextAPIKeys,
		map[string]superlink.APIKey{
			"Authorization": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]