Documentation ¶
Index ¶
- Constants
- func LoadJSON(a *Archive, id string, v interface{}) error
- func LoadXML(a *Archive, id string, v interface{}) error
- type Archive
- func (a *Archive) Attributes(id string) (Attributes, error)
- func (a *Archive) Close() error
- func (a *Archive) Delete(id string) error
- func (a *Archive) ExportFile(id string, file string) error
- func (a *Archive) ImportFile(id string, file string) error
- func (a *Archive) List() ([]Descriptor, error)
- func (a *Archive) ListWithPrefix(prefix string) ([]Descriptor, error)
- func (a *Archive) Load(id string) (Resource, error)
- func (a *Archive) Revision() int
- func (a *Archive) Store(r Resource) error
- type Attributes
- type Descriptor
- type Entries
- type Entry
- type Resource
- func GenericJSON(id string, v interface{}) Resource
- func GenericXML(id string, v interface{}) (Resource, error)
- func JPEG(id string, data []byte) Resource
- func JSON(id string, t string, v interface{}) Resource
- func MakeResource(id string, as Attributes, data []byte) Resource
- func TextPlain(id string, text string) Resource
- func XML(id string, t string, v interface{}) (Resource, error)
Constants ¶
View Source
const ( AttributeEncoding = "Encoding" AttributeETag = "ETag" AttributeExpires = "Expires" AttributeLastModified = "Last-Modified" AttributeLabel = "Label" AttributeLength = "Length" AttributeType = "Type" )
View Source
const ( TypeApplicationJSON = "application/json" TypeApplicationPDF = "application/pdf" TypeApplicationXML = "application/xml" TypeImageJPEG = "image/jpeg" TypeImagePNG = "image/png" TypeImageSVG = "image/svg+xml" TypeTextCSV = "text/csv" TypeTextHTML = "text/html" TypeTextPlain = "text/plain" )
View Source
const ( EncodingIdentity = "identity" EncodingGZIP = "gzip" )
View Source
const (
InfoRevision = "Revision"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Archive ¶
type Archive struct {
// contains filtered or unexported fields
}
func (*Archive) Attributes ¶
func (a *Archive) Attributes(id string) (Attributes, error)
func (*Archive) List ¶
func (a *Archive) List() ([]Descriptor, error)
func (*Archive) ListWithPrefix ¶
func (a *Archive) ListWithPrefix(prefix string) ([]Descriptor, error)
type Attributes ¶
func ParseAttributes ¶
func ParseAttributes(data string) (Attributes, error)
func (Attributes) Clone ¶
func (as Attributes) Clone() Attributes
func (Attributes) Entries ¶
func (as Attributes) Entries() Entries
func (Attributes) String ¶
func (as Attributes) String() string
type Descriptor ¶
type Descriptor struct { ID string Attributes Attributes }
type Resource ¶
type Resource struct { ID string Attributes Attributes Data []byte }
func GenericJSON ¶
func GenericXML ¶
func MakeResource ¶
func MakeResource(id string, as Attributes, data []byte) Resource
Click to show internal directories.
Click to hide internal directories.