Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PlatformFactories contains all supported platform factory. PlatformFactories map[types.Platform]func(*Base) IValidator )
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct { Platform types.Platform Previous string Action types.Action Pubkey *ecdsa.PublicKey // Identity on target platform. Identity string AltID string ProofLocation string Signature []byte SignaturePayload string Text string // Extra info needed by separate platforms (e.g. Ethereum) Extra map[string]string // CreatedAt indicates creation time of this link CreatedAt time.Time // Uuid gives this link an unique identifier, to let other // third-party service distinguish / store / dedup links with // ease. Uuid uuid.UUID }
type IValidator ¶
type IValidator interface { // GeneratePostPayload gives a post structure (with // placeholders) for user to post on target platform. GeneratePostPayload() (post map[string]string) // GenerateSignPayload generates a string to be signed. GenerateSignPayload() (payload string) Validate() (err error) }
func BaseToInterface ¶
func BaseToInterface(v *Base) IValidator
BaseToInterface converts a `validator.Base` struct to `validator.IValidator` interface.
Click to show internal directories.
Click to hide internal directories.