Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertLongTweetToImg(txt string, f *truetype.Font, fontSize float64) (image.Image, error)
- func DecryptRandomData(encryptedData string, passphrase []byte) (*big.Int, error)
- func GenerateRandomData(passphrase []byte) (string, []byte, error)
- func IsValidTwitterContent(text string) bool
- func LogInst() *zerolog.Logger
- func ParseTemplates(path string) *template.Template
- func ParseTweet(text string) (int, bool)
- func RandomBytesInHex(count int) string
- func ReadRequest(request *http.Request, obj any) error
- func SetLogLevel(ll, file string)
- func SplitIntoChunks(text string, chunkSize int) []string
- func TruncateString(raw, append string) string
- func Verify(address, message, signedMessage string) (string, error)
- type Block
- type JsonResponse
Constants ¶
View Source
const ( MaxReqContentLen = 1 << 23 MaxTwitterLen = 280 )
Variables ¶
View Source
var ( Version string Commit string BuildTime string ErrSignInvalid = errors.New("invalid signature") ErrSignNoAddr = errors.New("no public address found") ErrSignNotMatch = errors.New("signature address not match") ErrHttpEmptyRequest = errors.New("empty http post") )
View Source
var LogFileName = "server.log"
Functions ¶
func ConvertLongTweetToImg ¶
func DecryptRandomData ¶
func IsValidTwitterContent ¶ added in v1.0.1
func ParseTemplates ¶
func ParseTweet ¶ added in v1.0.1
ParseTweet calculates the length of a tweet text based on Twitter's specific rules.
func RandomBytesInHex ¶
func SetLogLevel ¶
func SetLogLevel(ll, file string)
func SplitIntoChunks ¶
func TruncateString ¶
Types ¶
type Block ¶ added in v1.0.1
type Block struct {
BaseFeePerGas string `json:"baseFeePerGas"`
Difficulty string `json:"difficulty"`
ExtraData string `json:"extraData"`
GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"`
Hash string `json:"hash"`
L1BlockNumber string `json:"l1BlockNumber"`
LogsBloom string `json:"logsBloom"`
Miner string `json:"miner"`
MixHash string `json:"mixHash"`
Nonce string `json:"nonce"`
Number string `json:"number"`
ParentHash string `json:"parentHash"`
ReceiptsRoot string `json:"receiptsRoot"`
SendCount string `json:"sendCount"`
SendRoot string `json:"sendRoot"`
Sha3Uncles string `json:"sha3Uncles"`
Size string `json:"size"`
StateRoot string `json:"stateRoot"`
Timestamp string `json:"timestamp"`
TimeStamp2 *big.Int
TotalDifficulty string `json:"totalDifficulty"`
Transactions []string `json:"transactions"`
TransactionsRoot string `json:"transactionsRoot"`
Uncles []string `json:"uncles"`
}
type JsonResponse ¶ added in v1.0.1
Click to show internal directories.
Click to hide internal directories.