// A Link is an indirect, qualified reference to a resource identified by a URL. The fundamental model for links is established by [ RFC5988]. Many of the properties defined by the Activity Vocabulary allow values that are either instances of Object or Link. When a Link is used, it establishes a qualified relation connecting the subject (the containing object) to the resource identified by the href. Properties of the Link are properties of the reference as opposed to properties of the resource. This is a convenience wrapper of a type with the same name in the vocab package. Accessing it with the Raw function allows direct manipulaton of the object, and does not provide the same integrity guarantees as this package.
typeLinkstruct{
// The raw type from the vocab package
raw*vocab.Link
}
// Raw returns the vocab type for manaual manipulation. Note that manipulating the underlying type to be in an inconsistent state may cause this convenience type's methods to later fail.
func(t*Link)Raw()(n*vocab.Link){
returnt.raw
}
// Serialize turns this object into a map[string]interface{}.
// LenAttributedTo returns the number of values this property contains. Each index be used with HasAttributedTo to determine if GetAttributedTo is safe to call or if raw handling would be needed.
func(t*Link)LenAttributedTo()(idxint){
returnt.raw.AttributedToLen()
}
// GetAttributedTo attempts to get this 'attributedTo' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
// AppendAttributedTo appends the value for property 'attributedTo'.
func(t*Link)AppendAttributedTo(k*url.URL){
t.raw.AppendAttributedToIRI(k)
}
// PrependAttributedTo prepends the value for property 'attributedTo'.
func(t*Link)PrependAttributedTo(k*url.URL){
t.raw.PrependAttributedToIRI(k)
}
// RemoveAttributedTo deletes the value from the specified index for property 'attributedTo'.
func(t*Link)RemoveAttributedTo(idxint){
t.raw.RemoveAttributedToIRI(idx)
}
// HasAttributedTo returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasAttributedTo(idxint)(pPresence){
p=NoPresence
ift.raw.IsAttributedToIRI(idx){
p=ConvenientPresence
}elseift.raw.IsAttributedToLink(idx){
p=RawPresence
}elseift.raw.IsAttributedToIRI(idx){
p=RawPresence
}
return
}
// GetHref attempts to get this 'href' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetHref()(rResolution,k*url.URL){
r=Unresolved
handled:=false
ift.raw.HasHref(){
k=t.raw.GetHref()
ifhandled{
r=Resolved
}
}
return
}
// HasHref returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasHref()(pPresence){
p=NoPresence
ift.raw.HasHref(){
p=ConvenientPresence
}
return
}
// SetHref sets the value for property 'href'.
func(t*Link)SetHref(k*url.URL){
t.raw.SetHref(k)
}
// GetId attempts to get this 'id' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetId()(rResolution,k*url.URL){
r=Unresolved
handled:=false
ift.raw.HasId(){
k=t.raw.GetId()
ifhandled{
r=Resolved
}
}
return
}
// HasId returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasId()(pPresence){
p=NoPresence
ift.raw.HasId(){
p=ConvenientPresence
}
return
}
// SetId sets the value for property 'id'.
func(t*Link)SetId(k*url.URL){
t.raw.SetId(k)
}
// LenRel returns the number of values this property contains. Each index be used with HasRel to determine if GetRel is safe to call or if raw handling would be needed.
func(t*Link)LenRel()(idxint){
returnt.raw.RelLen()
}
// GetRel attempts to get this 'rel' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetRel(idxint)(rResolution,kstring){
r=Unresolved
handled:=false
ift.raw.IsRel(idx){
k=t.raw.GetRel(idx)
ifhandled{
r=Resolved
}
}elseift.raw.IsRelIRI(idx){
r=RawResolutionNeeded
}
return
}
// AppendRel appends the value for property 'rel'.
func(t*Link)AppendRel(kstring){
t.raw.AppendRel(k)
}
// PrependRel prepends the value for property 'rel'.
func(t*Link)PrependRel(kstring){
t.raw.PrependRel(k)
}
// RemoveRel deletes the value from the specified index for property 'rel'.
func(t*Link)RemoveRel(idxint){
t.raw.RemoveRel(idx)
}
// HasRel returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasRel(idxint)(pPresence){
p=NoPresence
ift.raw.IsRel(idx){
p=ConvenientPresence
}elseift.raw.IsRelIRI(idx){
p=RawPresence
}
return
}
// LenType returns the number of values this property contains. Each index be used with HasType to determine if GetType is safe to call or if raw handling would be needed.
func(t*Link)LenType()(idxint){
returnt.raw.TypeLen()
}
// GetType attempts to get this 'type' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetType(idxint)(rResolution,sstring){
r=Unresolved
iftmp:=t.raw.GetType(idx);tmp!=nil{
ok:=false
ifs,ok=tmp.(string);ok{
r=Resolved
}else{
r=RawResolutionNeeded
}
}
return
}
// AppendType appends the value for property 'type'.
func(t*Link)AppendType(iinterface{}){
t.raw.AppendType(i)
}
// PrependType prepends the value for property 'type'.
func(t*Link)PrependType(iinterface{}){
t.raw.PrependType(i)
}
// RemoveType deletes the value from the specified index for property 'type'.
func(t*Link)RemoveType(idxint){
t.raw.RemoveType(idx)
}
// GetMediaType attempts to get this 'mediaType' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetMediaType()(rResolution,kstring){
r=Unresolved
handled:=false
ift.raw.IsMediaType(){
k=t.raw.GetMediaType()
ifhandled{
r=Resolved
}
}elseift.raw.IsMediaTypeIRI(){
r=RawResolutionNeeded
}
return
}
// HasMediaType returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasMediaType()(pPresence){
p=NoPresence
ift.raw.IsMediaType(){
p=ConvenientPresence
}elseift.raw.IsMediaTypeIRI(){
p=RawPresence
}
return
}
// SetMediaType sets the value for property 'mediaType'.
func(t*Link)SetMediaType(kstring){
t.raw.SetMediaType(k)
}
// LenName returns the number of values this property contains. Each index be used with HasName to determine if GetName is safe to call or if raw handling would be needed.
func(t*Link)LenName()(idxint){
returnt.raw.NameLen()
}
// GetName attempts to get this 'name' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetName(idxint)(rResolution,kstring){
r=Unresolved
handled:=false
ift.raw.IsNameString(idx){
k=t.raw.GetNameString(idx)
ifhandled{
r=Resolved
}
}elseift.raw.IsNameLangString(idx){
r=RawResolutionNeeded
}elseift.raw.IsNameIRI(idx){
r=RawResolutionNeeded
}
return
}
// AppendName appends the value for property 'name'.
func(t*Link)AppendName(kstring){
t.raw.AppendNameString(k)
}
// PrependName prepends the value for property 'name'.
func(t*Link)PrependName(kstring){
t.raw.PrependNameString(k)
}
// RemoveName deletes the value from the specified index for property 'name'.
func(t*Link)RemoveName(idxint){
t.raw.RemoveNameString(idx)
}
// HasName returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasName(idxint)(pPresence){
p=NoPresence
ift.raw.IsNameString(idx){
p=ConvenientPresence
}elseift.raw.IsNameLangString(idx){
p=RawPresence
}elseift.raw.IsNameIRI(idx){
p=RawPresence
}
return
}
// NameLanguages returns all languages for this property's language mapping, or nil if there are none.
func(t*Link)NameLanguages()(l[]string){
returnt.raw.NameMapLanguages()
}
// GetNameMap retrieves the value of 'name' for the specified language, or an empty string if it does not exist
func(t*Link)GetNameForLanguage(lstring)(vstring){
returnt.raw.GetNameMap(l)
}
// SetNameForLanguage sets the value of 'name' for the specified language
func(t*Link)SetNameForLanguage(lstring,vstring){
t.raw.SetNameMap(l,v)
}
// LenSummary returns the number of values this property contains. Each index be used with HasSummary to determine if GetSummary is safe to call or if raw handling would be needed.
func(t*Link)LenSummary()(idxint){
returnt.raw.SummaryLen()
}
// GetSummary attempts to get this 'summary' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
// GetHreflang attempts to get this 'hreflang' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetHreflang()(rResolution,kstring){
r=Unresolved
handled:=false
ift.raw.IsHreflang(){
k=t.raw.GetHreflang()
ifhandled{
r=Resolved
}
}elseift.raw.IsHreflangIRI(){
r=RawResolutionNeeded
}
return
}
// HasHreflang returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasHreflang()(pPresence){
p=NoPresence
ift.raw.IsHreflang(){
p=ConvenientPresence
}elseift.raw.IsHreflangIRI(){
p=RawPresence
}
return
}
// SetHreflang sets the value for property 'hreflang'.
func(t*Link)SetHreflang(kstring){
t.raw.SetHreflang(k)
}
// GetHeight attempts to get this 'height' property as a int64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetHeight()(rResolution,kint64){
r=Unresolved
handled:=false
ift.raw.IsHeight(){
k=t.raw.GetHeight()
ifhandled{
r=Resolved
}
}elseift.raw.IsHeightIRI(){
r=RawResolutionNeeded
}
return
}
// HasHeight returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasHeight()(pPresence){
p=NoPresence
ift.raw.IsHeight(){
p=ConvenientPresence
}elseift.raw.IsHeightIRI(){
p=RawPresence
}
return
}
// SetHeight sets the value for property 'height'.
func(t*Link)SetHeight(kint64){
t.raw.SetHeight(k)
}
// GetWidth attempts to get this 'width' property as a int64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling.
func(t*Link)GetWidth()(rResolution,kint64){
r=Unresolved
handled:=false
ift.raw.IsWidth(){
k=t.raw.GetWidth()
ifhandled{
r=Resolved
}
}elseift.raw.IsWidthIRI(){
r=RawResolutionNeeded
}
return
}
// HasWidth returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired.
func(t*Link)HasWidth()(pPresence){
p=NoPresence
ift.raw.IsWidth(){
p=ConvenientPresence
}elseift.raw.IsWidthIRI(){
p=RawPresence
}
return
}
// SetWidth sets the value for property 'width'.
func(t*Link)SetWidth(kint64){
t.raw.SetWidth(k)
}
// LenPreview returns the number of values this property contains. Each index be used with HasPreview to determine if ResolvePreview is safe to call or if raw handling would be needed.
func(t*Link)LenPreview()(idxint){
returnt.raw.PreviewLen()
}
// ResolvePreview passes the actual concrete type to the resolver for handing property preview. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired.