Categorygithub.com/ewhal/pastebin
modulepackage
0.0.0-20170418045510-7d2e1e2c2568
Repository: https://github.com/ewhal/pastebin.git
Documentation: pkg.go.dev

# README

Golang Pastebin

Build Status GoDoc Go Report Card MIT
licensed

Modern self-hosted pastebin service with a restful API.

Motivation

Many Pastebin services exist but all are more complicated than they need to be. That is why I decided to write a pastebin service in golang.

paste

Getting started

Prerequisities

  • pygmentize
  • go
  • mariadb
pip install pygmentize
sudo yum install -y go mariadb-server mariadb

Installing

  • Please note this assumes you have Mariadb and Go already setup.
  • go get github.com/ewhal/Pastebin
  • make
  • mysql -u root -p
  • CREATE USER 'paste'@'localhost' IDENTIFIED BY 'password';
  • CREATE database paste;
  • GRANT ALL PRIVILEGES ON paste . * TO 'paste'@'localhost';
  • FLUSH PRIVILEGES;
  • quit;
  • mysql -u paste -p paste < database.sql
  • cp config.example.json config.json
  • nano config.json
  • Configure port and database details

License

This project is licensed under the MIT License - see the LICENSE.md file for details

# Functions

APIHandler handles all.
CloneHandler handles generating the clone pages.
DelHandler handles the deletion of pastes.
DownloadHandler forces downloads of selected pastes.
RawHandler displays the pastes in text/plain format.
RootHandler handles generating the root page.
SaveHandler will handle the actual save of each paste.

# Structs

Configuration struct,.
This struct is used for generating pages.
No description provided by the author
This struct is used for indata when a request is being made to the pastebin.
This struct is used for responses.