Golang library for working with the Lenpaste API.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lcomrade 24dcb002fb
Update README.md
5 months ago
docs Added ./docs/examples.md 7 months ago
LICENSE first commit 7 months ago
README.md Update README.md 5 months ago
go.mod Added go.mod file and frequent problems to README.md 7 months ago
lenin.go Added one use paste support 7 months ago
lenin_type.go Added one use paste support 7 months ago

README.md

Go report Go Reference Release License

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