Documentation
¶
Overview ¶
Package sdk provides a Go SDK with which to interact with the Turnkey API service.
Index ¶
- Constants
- func NewHTTPClient(formats strfmt.Registry) *client.TurnkeyAPI
- func SetClientVersion(inner http.RoundTripper, clientVersion string) http.RoundTripper
- type Authenticator
- type Client
- type Logger
- type OptionFunc
- func WithAPIKey(apiKey *apikey.Key) OptionFunc
- func WithAPIKeyName(keyname string) OptionFunc
- func WithClientVersion(clientVersion string) OptionFunc
- func WithLogger(logger Logger) OptionFunc
- func WithRegistry(registry strfmt.Registry) OptionFunc
- func WithTransportConfig(transportConfig client.TransportConfig) OptionFunc
Constants ¶
const DefaultClientVersion = "go-sdk"
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
func NewHTTPClient(formats strfmt.Registry) *client.TurnkeyAPI
NewHTTPClient returns a new base HTTP API client. Most users will call New() instead. Deprecated: Use New(WithRegistry(formats)) instead.
func SetClientVersion ¶
func SetClientVersion(inner http.RoundTripper, clientVersion string) http.RoundTripper
Types ¶
type Authenticator ¶
type Authenticator struct { // Key optionally overrides the globally-parsed APIKeypair with a custom key. Key *apikey.Key }
Authenticator provides a runtime.ClientAuthInfoWriter for use with the swagger API client.
func (*Authenticator) AuthenticateRequest ¶
func (auth *Authenticator) AuthenticateRequest(req runtime.ClientRequest, reg strfmt.Registry) (err error)
AuthenticateRequest implements runtime.ClientAuthInfoWriter. It adds the X-Stamp header to the request based by generating the Stamp with the request body and API key.
type Client ¶
type Client struct { // Client is the base HTTP API Client. Client *client.TurnkeyAPI // Authenticator provides a client option authentication provider which should be attached to every API request as a clientOption. Authenticator *Authenticator // APIKey is the API key to be used for API request signing. APIKey *apikey.Key }
Client provides a handle by which to interact with the Turnkey API.
func New ¶
func New(options ...OptionFunc) (*Client, error)
New returns a new API Client with the given API key name from the default keystore.
func (*Client) DefaultOrganization ¶
DefaultOrganization returns the first organization found in the APIKey's set of organizations.
func (*Client) V0 ¶
func (c *Client) V0() *client.TurnkeyAPI
V0 returns the raw initial Turnkey API client. WARNING: this is a temporary API which requires a bit more work to use than the one which will be eventually offered.
type Logger ¶ added in v0.8.0
type Logger interface {
Printf(format string, v ...interface{})
}
Logger defines a minimal logging interface. Compatible with stdlib log.Logger, zap.SugaredLogger, etc.
type OptionFunc ¶
type OptionFunc func(c *config) error
OptionFunc defines a function which sets configuration options for a Client.
func WithAPIKey ¶
func WithAPIKey(apiKey *apikey.Key) OptionFunc
WithAPIKey sets the API key used for this API client. Users would normally use WithAPIKeyName. This offers a lower-level custom API key.
func WithAPIKeyName ¶
func WithAPIKeyName(keyname string) OptionFunc
WithAPIKeyName sets the API key to the key loaded from the local keystore with the provided name.
func WithClientVersion ¶
func WithClientVersion(clientVersion string) OptionFunc
WithClientVersion overrides the client version used for this API client.
func WithLogger ¶ added in v0.8.0
func WithLogger(logger Logger) OptionFunc
WithLogger sets a custom logger for the SDK. Defaults to fmt.Printf if none is provided.
func WithRegistry ¶
func WithRegistry(registry strfmt.Registry) OptionFunc
WithRegistry sets the registry formats used for this API client.
func WithTransportConfig ¶
func WithTransportConfig(transportConfig client.TransportConfig) OptionFunc
WithTransportConfig sets the TransportConfig used for this API client.
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
apikey
command
|
|
delegated_access
command
Package main demonstrates the delegated access setup For details check our docs https://docs.turnkey.com/concepts/policies/delegated-access
|
Package main demonstrates the delegated access setup For details check our docs https://docs.turnkey.com/concepts/policies/delegated-access |
email_otp/init_otp
command
|
|
email_otp/verify_otp
command
|
|
private_keys/import_private_key
command
Package main demonstrates a Secp256k1 or Ed25519 private key import
|
Package main demonstrates a Secp256k1 or Ed25519 private key import |
signing/sign_raw_payload
command
Package main demonstrates an API client which signs a raw payload with a wallet account
|
Package main demonstrates an API client which signs a raw payload with a wallet account |
signing/sign_transaction
command
Package main demonstrates an API client which signs a transaction with a private key ID or wallet account.
|
Package main demonstrates an API client which signs a transaction with a private key ID or wallet account. |
wallets/create_wallet
command
Package main demonstrates an API client which creates a new wallet with a wallet account.
|
Package main demonstrates an API client which creates a new wallet with a wallet account. |
wallets/create_wallet_accounts
command
Package main demonstrates an API client which creates new wallet accounts.
|
Package main demonstrates an API client which creates new wallet accounts. |
wallets/export_wallet
command
|
|
wallets/export_wallet_account
command
|
|
wallets/import_wallet
command
Package main demonstrates a wallet import from menmonic
|
Package main demonstrates a wallet import from menmonic |
whoami
command
Package main demonstrates an API client which returns the UserID of its API key.
|
Package main demonstrates an API client which returns the UserID of its API key. |
pkg
|
|
apikey
Package apikey manages Turnkey API keys for organizations
|
Package apikey manages Turnkey API keys for organizations |
common
Package common contains key and key metadata interfaces
|
Package common contains key and key metadata interfaces |
encryptionkey
Package encryptionkey manages encryption keys for users
|
Package encryptionkey manages encryption keys for users |
store
Package store defines a key storage interface.
|
Package store defines a key storage interface. |
store/local
Package local provides a keystore based on a local directory.
|
Package local provides a keystore based on a local directory. |
store/ram
Package ram defines a RAM-based apikey store.
|
Package ram defines a RAM-based apikey store. |
util
Package util provides convenience utilities for interacting with the API.
|
Package util provides convenience utilities for interacting with the API. |
enclave_encrypt
module
|