
Repository archiving
This repository has been permanently moved to my own Git server.
Stay tuned for updates here: https://git.lcomrade.su/root/lenin
Read about the reason for this action here: https://github.com/lcomrade/lcomrade#give-up-github
Lenin is a golang library for working with the Lenpaste API.
NOTE:
Library releases correspond to the Lenpaste server releases.
Install
go get github.com/lcomrade/lenin
Example
Create new paste:
package main
import(
"github.com/lcomrade/lenin"
"fmt"
)
func main() {
// Base API URL
baseURL := "https://paste.lcomrade.su/api"
//Clean base URL
baseURL = lenin.CleanURL(baseURL)
// Create request
req := lenin.NewReq {
Title: "Lenin library",
Text: "Lenin is a golang library for working with the Lenpaste API",
Expiration: "5m",
}
// Do request
resp, err := lenin.New(req, baseURL)
if err != nil {
panic(err)
}
// Print result
fmt.Println("Paste name:", resp.Name)
}
Documentation