paste

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unlisted Visibility = "unlisted"
	Public              = "public"
	Private             = "private"
)
View Source
const ApiUrl = "https://paste.sr.ht/api"

Variables

This section is empty.

Functions

func Create

func Create(name string, visibility Visibility, contents string)

Types

type Blob

type Blob struct {
	Filename string // No JSON field, have to set this manually
	ID       string `json:"sha"`
	Contents string `json:"contents"`
}

This is the structure for paste loading from the API

type Paste

type Paste struct {
	CreatedAt  time.Time  `json:"created"`
	Visibility Visibility `json:"visibility"`
	Sha        string     `json:"sha"`
	Files      []file     `json:"files"`
	User       struct {
		CanonicalName string `json:"canonical_name"`
		Name          string `json:"name"`
	}
}

func List

func List() []Paste

func (Paste) Delete

func (p Paste) Delete()

func (Paste) LoadFiles

func (p Paste) LoadFiles() []Blob

func (Paste) URL

func (p Paste) URL() string

type Visibility

type Visibility string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL