Documentation ¶
Index ¶
- Variables
- func Init(conf *env.Config)
- func ValidateSignatureAndTS(channelClaimID, signature, signingTS, data string) error
- func ValidateSignatureAndTSForClaim(channelClaimID, claimID, signature, signingTS, data string) error
- func ValidateSignatureFromClaim(channel *jsonrpc.Claim, signature, signingTS, data string) error
- func ValidateSignatureNoTSLimit(channelClaimID, signature, signingTS, data string) error
- type APIClient
- type Channel
- type CheckPerkOptions
- type CheckPerkResponse
- type CommentResponse
- type NotifyOptions
- type SDKClient
Constants ¶
This section is empty.
Variables ¶
var ValidateSignatures bool
ValidateSignatures determines if signatures should be validated or not ( not used yet)
Functions ¶
func Init ¶
Init initializes the configuration of the LBRY clients and allows for mock clients for testing
func ValidateSignatureAndTS ¶
ValidateSignatureAndTS validates the signature was signed by the channel reference.
func ValidateSignatureAndTSForClaim ¶
func ValidateSignatureAndTSForClaim(channelClaimID, claimID, signature, signingTS, data string) error
ValidateSignatureAndTSForClaim validates the signature was signed by the channel reference for a particular claim id.
func ValidateSignatureFromClaim ¶
ValidateSignatureFromClaim validates the signature was signed by the channel reference.
func ValidateSignatureNoTSLimit ¶
ValidateSignatureNoTSLimit validates the signature was signed by the channel reference.
Types ¶
type APIClient ¶
type APIClient interface { Notify(NotifyOptions) CheckPerk(CheckPerkOptions) (bool, error) }
APIClient is the interface type for internal-api calls
var API APIClient
API is the API entrypoint for internal-api calls
type Channel ¶
type Channel struct { Name string `json:"name"` ChannelID string `json:"channel_id"` HoldingAddress string `json:"holding_address"` HoldingPublicKey string `json:"holding_public_key"` SigningPrivateKey string `json:"signing_private_key"` }
Channel structure representing an exported LBRY channel
func ImportChannel ¶
ImportChannel creates a Channel representation from the serialization
func (*Channel) Keys ¶
func (l *Channel) Keys() (*btcec.PrivateKey, *btcec.PublicKey)
Keys will return the private and public key of a channel
func (*Channel) Sign ¶
Sign will sign the data with the channels private key returning the signature and a timestamp it was signed. This is used in the signature itself so it is required input to verify the signature. This ensures someone cannot fudge a timestamp of a signature and allows for expiration times of signatures.
type CheckPerkOptions ¶
type CheckPerkOptions struct { ChannelClaimID string ClaimID string Type string Environment *string }
CheckPerkOptions Are the options used to construct the permission lookup request.
type CheckPerkResponse ¶
type CheckPerkResponse struct { Success bool `json:"success"` Error interface{} `json:"error"` Data struct { HasAccess bool `json:"has_access"` } `json:"data"` }
CheckPerkResponse is the response structure from internal-apis for the comment event api
type CommentResponse ¶
type CommentResponse struct { Success bool `json:"success"` Error interface{} `json:"error"` Data string `json:"data"` }
CommentResponse is the response structure from internal-apis for the comment event api
type NotifyOptions ¶
type NotifyOptions struct { ActionType string CommentID string ChannelID *string ParentID *string Comment *string ClaimID string Amount uint64 IsFiat bool Currency *string IsProtected bool }
NotifyOptions Are the options used to construct the comment event api signature.
type SDKClient ¶
type SDKClient interface { GetTx(txid string) (*jsonrpc.TransactionSummary, error) GetClaim(claimID string) (*jsonrpc.Claim, error) GetSigningChannelForClaim(claimID string) (*jsonrpc.Claim, error) }
SDKClient is the interface type for SDK call
var SDK SDKClient
SDK is the API entrypoint for LBRYSDK calls