putxt

package module
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 12 Imported by: 1

README

PuTXT

NOTE: This API is anything but stable

Documentation

Index

Constants

View Source
const (
	MessageRatelimited   = "RATELIMIT_REACHED"
	MessageSizeLimited   = "MAX_SIZE_EXCEEDED"
	MessageBinaryData    = "BINARY_DATA_REJECTED"
	MessageInternalError = "INTERNAL_ERROR"
)

Variables

This section is empty.

Functions

func IsText added in v0.2.4

func IsText(s []byte) bool

slightly modified from golang.org/x/tools/godoc/util to include carriage return for dirty windows users

Types

type Handler

type Handler interface {
	Ingest(data []byte) ([]byte, error)
}

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
}

type TermDumpster

type TermDumpster struct {
	Pool pool.BufferFactory
	*rate5.Limiter
	// contains filtered or unexported fields
}

func NewTermDumpster

func NewTermDumpster(handler Handler) *TermDumpster

func (*TermDumpster) Listen

func (td *TermDumpster) Listen(addr string, port string) error

Listen starts the TCP server

func (*TermDumpster) ListenUnixSocket

func (td *TermDumpster) ListenUnixSocket(path string) error

ListenUnixSocket starts the unix socket listener

func (*TermDumpster) WithGzip

func (td *TermDumpster) WithGzip() *TermDumpster

func (*TermDumpster) WithLogger

func (td *TermDumpster) WithLogger(logger Logger) *TermDumpster

func (*TermDumpster) WithMaxSize

func (td *TermDumpster) WithMaxSize(size int64) *TermDumpster

func (*TermDumpster) WithTimeout

func (td *TermDumpster) WithTimeout(timeout time.Duration) *TermDumpster

Jump to

Keyboard shortcuts

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