Documentation ¶
Overview ¶
- Copyright (C) 2014 Stefan Luecke *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. *
- Authors: Stefan Luecke <glaxx@glaxx.net>
go_pastebin offers functions to interact with the Pastebin API, for further information check http://pastebin.com/api .
Index ¶
- type Paste
- type Pastebin
- func (pb *Pastebin) DeletePaste(apiPasteKey string) (err error)
- func (pb *Pastebin) GenerateUserSession(apiUsername, apiPassword string) (p *Pastebin, err error)
- func (pb *Pastebin) ListPastes(resultLimit int) (pastes []Paste, err error)
- func (pb *Pastebin) ListTrendingPastes() (pastes []Paste, err error)
- func (pb *Pastebin) Paste(...) (pasteURL *url.URL, err error)
- func (pb *Pastebin) PasteAnonymous(paste, title, format, expire, private string) (pasteURL *url.URL, err error)
- func (pb *Pastebin) PasteAnonymousSimple(apiPasteCode string) (pasteURL *url.URL, err error)
- func (pb *Pastebin) PasteSimple(apiPasteCode string) (pasteURL *url.URL, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Paste ¶
type Paste struct { PasteKey string PasteDate time.Time PasteTitle string PasteSize int PasteExpireDate time.Time PastePrivate int PasteFormatLong string PasteFormatShort string PasteURL *url.URL PasteHits int }
Paste represents output structure from pastebin api
type Pastebin ¶
type Pastebin struct {
// contains filtered or unexported fields
}
Pastebin represents pastebin session
func NewPastebin ¶
NewPastebin creates a new session and hold api keys
func (*Pastebin) DeletePaste ¶
DeletePaste deletes a paste, which is referenced by the paste_key.
func (*Pastebin) GenerateUserSession ¶
GenerateUserSession request (and returns) a Session key object, which is necessary for all user based tasks.
func (*Pastebin) ListPastes ¶
ListPastes request (and returns) an array of pastes, which are referenced by the user.
func (*Pastebin) ListTrendingPastes ¶
ListTrendingPastes request (and returns) an array of trending pastes.
func (*Pastebin) Paste ¶
func (pb *Pastebin) Paste(apiPasteCode, apiPasteName, apiPasteFormat, apiPasteExpire, apiPastePrivate string) (pasteURL *url.URL, err error)
Paste posts a text (paste) to Pastebin. If successfull this function will return a URL reference to the past and nil as error. format, expire and private should be set according to pastebin.com/api .
func (*Pastebin) PasteAnonymous ¶
func (pb *Pastebin) PasteAnonymous(paste, title, format, expire, private string) (pasteURL *url.URL, err error)
PasteAnonymous posts a text (paste) to Pastebin. If successfull this function will return a URL reference to the past and nil as error. format, expire and private should be set according to pastebin.com/api .
func (*Pastebin) PasteAnonymousSimple ¶
PasteAnonymousSimple posts a text (paste) to Pastebin. If successfull this function will return a URL reference to the past and nil as error. title, format, expire and private are defaulted by Pastebin.
func (*Pastebin) PasteSimple ¶
PasteSimple posts a text (paste) to Pastebin. If successfull this function will return a URL reference to the past and nil as error. title, format, expire and private are defaulted by Pastebin.