paste

package
v0.0.0-...-1ca2d18 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoPasteFound = errors.New("no paste found")

Functions

This section is empty.

Types

type Module

type Module struct {
	ID        int    `json:"-"`
	Text      string `json:"text,omitempty"`
	Lang      string `json:"lang,omitempty"`
	LineCount int    `json:"linecount,omitempty"`
	Address   string `json:"address,omitempty"`
	TimeStamp string `json:"-"`
}

type Paste

type Paste struct {
	// contains filtered or unexported fields
}

func New

func New(store store, config config.Config) Paste

New returns a instance of Paste.

func (Paste) Create

func (u Paste) Create(r *http.Request, m Module) (string, error)

Create creates a new paste in store.

func (Paste) Get

func (u Paste) Get(r *http.Request, addr string) (Module, error)

Get gets paste by its address.

func (Paste) Render

func (u Paste) Render(m Module) (string, error)

Render render text in selected syntax highlighted language.

type TemplateData

type TemplateData struct {
	Address         string
	TextHighlighted string
	LineCount       int
	Lang            string
	Message         string
	IncludeHome     bool
}

Jump to

Keyboard shortcuts

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