Skip to content

arminaaki/gopastebin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gopastebin

E2E

Pastebin GO API

The work is currently in Progress, but PRs are welcome!

Install

go get https://github.com/arminaaki/gopastebin

Usage

import "https://github.com/arminaaki/gopastebin"

Examples

//Create pastbin API Client
client, _ := NewClient(&AccountRequest{
	APIDevKey:       os.Getenv("PASTEBIN_API_DEV_KEY"),
	APIUserName:     os.Getenv("PASTEBIN_API_USER_NAME"),
	APIUserPassword: os.Getenv("PASTEBIN_API_USER_PASSWORD"),
})

// Create a past
_, _, err := client.Paste.Create(nil, &PasteRequest{
	APIPasteName:       "main.rb",
	APIPasteCode:       "puts \"Hello World!\"",
	APIPasteFormat:     "ruby",
	APIPastePrivate:    APIOptionPrivate,
	APIPasteExpireDate: "1M",
})

if err != nil {
	panic(err)
}