shared

package
v0.0.0-...-317d7e6 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageTypeFile     = StorageType("file")
	StorageTypePostgres = StorageType("postgres")
	StorageTypeMongoDB  = StorageType("mongodb")
	StorageTypeS3       = StorageType("s3")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Paste

type Paste struct {
	ID                string                 `json:"id" bson:"_id"`
	Content           string                 `json:"content" bson:"content"`
	DeletionToken     string                 `json:"deletionToken,omitempty" bson:"deletionToken"` // Required for legacy paste storage support
	ModificationToken string                 `json:"modificationToken,omitempty" bson:"modificationToken"`
	Created           int64                  `json:"created" bson:"created"`
	Metadata          map[string]interface{} `json:"metadata" bson:"metadata"`
}

Paste represents a saved paste

func (*Paste) CheckModificationToken

func (paste *Paste) CheckModificationToken(modificationToken string) bool

CheckModificationToken checks whether or not the given modification token is correct

func (*Paste) HashModificationToken

func (paste *Paste) HashModificationToken() error

HashModificationToken hashes the current modification token of a paste

type StorageType

type StorageType string

StorageType represents a type of storage a paste can be stored with

Jump to

Keyboard shortcuts

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