document

package
v0.0.0-...-49ede41 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2017 License: MIT Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	DEFAULT_CONTENT_TYPE string = "text/plain"
	CONTENT_TYPE_REGEX   string = "[A-z0-9]+\\/[A-z0-9]+"
	NEVER_EXPIRES        string = "never"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Key         string      `json:"key"`
	Value       []byte      `json:"value"`
	ContentType string      `json:"content_type"`
	Expired     bool        `json:"_expired"`
	CreatedAt   interface{} `json:"_created_at"`
	ExpiresAt   interface{} `json:"_expires_at"`
}

func New

func New(key string, value []byte, contentType string, expAfterSec int) *Document

func (*Document) Expire

func (d *Document) Expire() *Document

Make this document expired.

func (*Document) String

func (d *Document) String() string

func (*Document) Update

func (d *Document) Update(value []byte, expAfterSec int) *Document

Jump to

Keyboard shortcuts

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