server

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PURPLE = "\033[0;35m"
	RED    = "\033[0;31m"
	BLUE   = "\033[0;34m"
	YELLOW = "\033[0;33m"
	RESET  = "\033[0m"
)

colors

View Source
const Version string = "0.2.3"

Version exported

Variables

View Source
var DebugLog = log.New(os.Stdout, "["+YELLOW+"DEBUG"+RESET+"] ", log.LstdFlags|log.Lmicroseconds)

DebugLog debug logger

View Source
var ErrorLog = log.New(os.Stdout, "["+RED+"ERROR"+RESET+"] ", log.LstdFlags|log.Lmicroseconds)

ErrorLog error logger

View Source
var InfoLog = log.New(os.Stdout, "["+BLUE+"INFO "+RESET+"] ", log.LstdFlags|log.Lmicroseconds)

InfoLog info logger

Functions

func DefaultHandler added in v0.2.3

func DefaultHandler(w http.ResponseWriter, r *http.Request)

DefaultHandler return the chipku version

func FetchHandler added in v0.2.3

func FetchHandler(w http.ResponseWriter, r *http.Request)

FetchHandler GET handler function for fetching the code snippets

func IndexFileServer added in v0.2.3

func IndexFileServer() http.Handler

IndexFileServer read the static html and return the http handler

func PastePostHandler added in v0.2.3

func PastePostHandler(w http.ResponseWriter, r *http.Request)

PastePostHandler POST handler func for managing snippets being posted via form

func PastePutHandler added in v0.2.3

func PastePutHandler(w http.ResponseWriter, r *http.Request)

PastePutHandler PUT handler func for managing snippets sent via PUT

func RandStringBytes

func RandStringBytes(n int) string

RandStringBytes return a random string bytes of size n

func Serve

func Serve(port string)

Serve exported

Types

type CodeData

type CodeData struct {
	Code string
}

CodeData exported

Jump to

Keyboard shortcuts

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