root
/
lenin
Archived
1
0
Fork 0
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
Leonid Maslakov d9f2524a2f Archive repo 3 months ago
docs Archive repo 3 months ago
LICENSE first commit 12 months ago
README.md Archive repo 3 months ago
go.mod Archive repo 3 months ago
lenin.go Added one use paste support 12 months ago
lenin_type.go Added one use paste support 12 months ago

README.md

Repository archiving

This library was archived because a replacement was written for it. Under the MIT license: https://git.lcomrade.su/root/pasteapi.go

Lenin is a golang library for working with the Lenpaste API.

NOTE: Library releases correspond to the Lenpaste server releases.

Install

go get git.lcomrade.su/root/lenin

Example

Create new paste:

package main

import(
	"git.lcomrade.su/root/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