Documentation
¶
Index ¶
- Constants
- Variables
- func GetURI(base string, key []string) (u string)
- func MakeLinkType(t string) string
- func ParsePath(p string) []string
- type Assertion
- type File
- type Package
- func (pkg *Package) CopyResource() *Reference
- func (pkg *Package) ETag() string
- func (pkg *Package) Fragment() (c cid.Cid, fragment string)
- func (pkg *Package) JsonLd(context string) (map[string]interface{}, error)
- func (pkg *Package) Name() string
- func (pkg *Package) Path() path.Resolved
- func (pkg *Package) SearchAssertions(name string, isCid bool) (int, *Assertion)
- func (pkg *Package) SearchFiles(name string, isCid bool) (int, *File)
- func (pkg *Package) SearchPackages(name string, isCid bool) (int, *Reference)
- func (pkg *Package) T() ResourceType
- func (pkg *Package) Type() string
- func (pkg *Package) URI() string
- func (pkg *Package) ValuePath() path.Resolved
- type Reference
- type Resource
- type ResourceType
Constants ¶
View Source
const ( LDPResource = "http://www.w3.org/ns/ldp#Resource" LDPDirectContainer = "http://www.w3.org/ns/ldp#DirectContainer" LDPRDFSource = "http://www.w3.org/ns/ldp#RDFSource" LDPNonRDFSource = "http://www.w3.org/ns/ldp#NonRDFSource" )
Variables ¶
View Source
var AssertionURIPattern = regexp.MustCompile("^ul:([a-z2-7]{59})$")
View Source
var EmptyDirectoryURI = "dweb:/ipfs/bafybeiczsscdsbs7ffqz55asqdf3smv6klcw3gofszvwlyarci47bgf354"
View Source
var FileURIPattern = regexp.MustCompile("^dweb:/ipfs/([a-z2-7]{59})$")
View Source
var LinkTypeDirectContainer = MakeLinkType(LDPDirectContainer)
View Source
var LinkTypeNonRDFSource = MakeLinkType(LDPNonRDFSource)
View Source
var LinkTypeRDFSource = MakeLinkType(LDPRDFSource)
View Source
var LinkTypeResource = MakeLinkType(LDPResource)
View Source
var NQuadsFileExtension = ".nq"
View Source
var PackageURIPattern = regexp.MustCompile("^ul:([a-z2-7]{59})#(c14n\\d+)$")
Functions ¶
func MakeLinkType ¶
Types ¶
type Assertion ¶
type Assertion struct { ID string `json:"id,omitempty"` Resource string `json:"resource,omitempty"` Title string `json:"title,omitempty"` Created string `json:"created,omitempty"` Modified string `json:"modified,omitempty"` Dataset []*rdf.Quad `json:"-"` }
func (*Assertion) T ¶
func (a *Assertion) T() ResourceType
type File ¶
type File struct { ID string `json:"id,omitempty"` Resource string `json:"resource,omitempty"` Title string `json:"title,omitempty"` Created string `json:"created,omitempty"` Modified string `json:"modified,omitempty"` Extent int `json:"extent"` Format string `json:"format"` }
func (*File) T ¶
func (f *File) T() ResourceType
type Package ¶
type Package struct { Reference Created string `json:"created,omitempty"` Modified string `json:"modified,omitempty"` Description string `json:"description,omitempty"` Keywords []string `json:"keywords,omitempty"` Parent string `json:"parent,omitempty"` Value struct { ID string `json:"id"` Extent int `json:"extent"` } `json:"value"` Members struct { Packages []*Reference `json:"packages,omitempty"` Assertions []*Assertion `json:"assertions,omitempty"` Files []*File `json:"files,omitempty"` } `json:"members,omitempty"` }
func NewPackage ¶
NewPackage creates a new timestamped package.
func (*Package) CopyResource ¶
func (*Package) SearchAssertions ¶
func (*Package) SearchPackages ¶
func (*Package) T ¶
func (pkg *Package) T() ResourceType
type Reference ¶
type Reference struct { ID string `json:"id,omitempty"` Resource string `json:"resource,omitempty"` Title string `json:"title,omitempty"` }
func (*Reference) T ¶
func (r *Reference) T() ResourceType
type ResourceType ¶
type ResourceType uint8
ResourceType is an enum for resource types
const ( // PackageType = 1 the ResourceType for Packages PackageType ResourceType // AssertionType = 2 the ResourceType for Assertions AssertionType // FileType = 3 is the ResourceType for Files FileType )
func ParseLinks ¶
func ParseLinks(links []string) (self string, t ResourceType)
Click to show internal directories.
Click to hide internal directories.