validator

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 H

type H map[string]any

H for JSON builder.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL