typelink

package
v1.8.0-gts Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package typelink contains the implementation for the Link type. All applications are strongly encouraged to use the interface instead of this concrete definition. The interfaces allow applications to consume only the types and properties needed and be independent of the go-fed implementation if another alternative implementation is created. This package is code-generated and subject to the same license as the go-fed tool used to generate it.

This package is independent of other types' and properties' implementations by having a Manager injected into it to act as a factory for the concrete implementations. The implementations have been generated into their own separate subpackages for each vocabulary.

Strongly consider using the interfaces instead of this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivityStreamsLinkExtends

func ActivityStreamsLinkExtends(other vocab.Type) bool

ActivityStreamsLinkExtends returns true if the Link type extends from the other type.

func IsOrExtendsLink(other vocab.Type) bool

IsOrExtendsLink returns true if the other provided type is the Link type or extends from the Link type.

func LinkIsDisjointWith

func LinkIsDisjointWith(other vocab.Type) bool

LinkIsDisjointWith returns true if the other provided type is disjoint with the Link type.

func LinkIsExtendedBy

func LinkIsExtendedBy(other vocab.Type) bool

LinkIsExtendedBy returns true if the other provided type extends from the Link type. Note that it returns false if the types are the same; see the "IsOrExtendsLink" variant instead.

func SetManager

func SetManager(m privateManager)

SetManager sets the manager package-global variable. For internal use only, do not use as part of Application behavior. Must be called at golang init time.

func SetTypePropertyConstructor

func SetTypePropertyConstructor(f func() vocab.JSONLDTypeProperty)

SetTypePropertyConstructor sets the "type" property's constructor in the package-global variable. For internal use only, do not use as part of Application behavior. Must be called at golang init time. Permits ActivityStreams types to correctly set their "type" property at construction time, so users don't have to remember to do so each time. It is dependency injected so other go-fed compatible implementations could inject their own type.

Types

type ActivityStreamsLink struct {
	ActivityStreamsAttributedTo vocab.ActivityStreamsAttributedToProperty
	ActivityStreamsHeight       vocab.ActivityStreamsHeightProperty
	ActivityStreamsHref         vocab.ActivityStreamsHrefProperty
	ActivityStreamsHreflang     vocab.ActivityStreamsHreflangProperty
	JSONLDId                    vocab.JSONLDIdProperty
	ActivityStreamsMediaType    vocab.ActivityStreamsMediaTypeProperty
	ActivityStreamsName         vocab.ActivityStreamsNameProperty
	ActivityStreamsPreview      vocab.ActivityStreamsPreviewProperty
	ActivityStreamsRel          vocab.ActivityStreamsRelProperty
	ActivityStreamsSummary      vocab.ActivityStreamsSummaryProperty
	JSONLDType                  vocab.JSONLDTypeProperty
	ActivityStreamsWidth        vocab.ActivityStreamsWidthProperty
	// contains filtered or unexported fields
}

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.

Example 2 (https://www.w3.org/TR/activitystreams-vocabulary/#ex2-jsonld):

{
  "hreflang": "en",
  "mediaType": "text/html",
  "name": "An example link",
  "type": "Link",
  "url": "http://example.org/abc"
}
func DeserializeLink(m map[string]interface{}, aliasMap map[string]string) (*ActivityStreamsLink, error)

DeserializeLink creates a Link from a map representation that has been unmarshalled from a text or binary format.

func NewActivityStreamsLink() *ActivityStreamsLink

NewActivityStreamsLink creates a new Link type

func (ActivityStreamsLink) GetActivityStreamsAttributedTo

func (this ActivityStreamsLink) GetActivityStreamsAttributedTo() vocab.ActivityStreamsAttributedToProperty

GetActivityStreamsAttributedTo returns the "attributedTo" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsHeight

func (this ActivityStreamsLink) GetActivityStreamsHeight() vocab.ActivityStreamsHeightProperty

GetActivityStreamsHeight returns the "height" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsHref

func (this ActivityStreamsLink) GetActivityStreamsHref() vocab.ActivityStreamsHrefProperty

GetActivityStreamsHref returns the "href" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsHreflang

func (this ActivityStreamsLink) GetActivityStreamsHreflang() vocab.ActivityStreamsHreflangProperty

GetActivityStreamsHreflang returns the "hreflang" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsMediaType

func (this ActivityStreamsLink) GetActivityStreamsMediaType() vocab.ActivityStreamsMediaTypeProperty

GetActivityStreamsMediaType returns the "mediaType" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsName

func (this ActivityStreamsLink) GetActivityStreamsName() vocab.ActivityStreamsNameProperty

GetActivityStreamsName returns the "name" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsPreview

func (this ActivityStreamsLink) GetActivityStreamsPreview() vocab.ActivityStreamsPreviewProperty

GetActivityStreamsPreview returns the "preview" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsRel

func (this ActivityStreamsLink) GetActivityStreamsRel() vocab.ActivityStreamsRelProperty

GetActivityStreamsRel returns the "rel" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsSummary

func (this ActivityStreamsLink) GetActivityStreamsSummary() vocab.ActivityStreamsSummaryProperty

GetActivityStreamsSummary returns the "summary" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetActivityStreamsWidth

func (this ActivityStreamsLink) GetActivityStreamsWidth() vocab.ActivityStreamsWidthProperty

GetActivityStreamsWidth returns the "width" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetJSONLDId

func (this ActivityStreamsLink) GetJSONLDId() vocab.JSONLDIdProperty

GetJSONLDId returns the "id" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetJSONLDType

func (this ActivityStreamsLink) GetJSONLDType() vocab.JSONLDTypeProperty

GetJSONLDType returns the "type" property if it exists, and nil otherwise.

func (ActivityStreamsLink) GetTypeName

func (this ActivityStreamsLink) GetTypeName() string

GetTypeName returns the name of this type.

func (ActivityStreamsLink) GetUnknownProperties

func (this ActivityStreamsLink) GetUnknownProperties() map[string]interface{}

GetUnknownProperties returns the unknown properties for the Link type. Note that this should not be used by app developers. It is only used to help determine which implementation is LessThan the other. Developers who are creating a different implementation of this type's interface can use this method in their LessThan implementation, but routine ActivityPub applications should not use this to bypass the code generation tool.

func (ActivityStreamsLink) IsExtending

func (this ActivityStreamsLink) IsExtending(other vocab.Type) bool

IsExtending returns true if the Link type extends from the other type.

func (ActivityStreamsLink) JSONLDContext

func (this ActivityStreamsLink) JSONLDContext() map[string]string

JSONLDContext returns the JSONLD URIs required in the context string for this type and the specific properties that are set. The value in the map is the alias used to import the type and its properties.

func (ActivityStreamsLink) LessThan

LessThan computes if this Link is lesser, with an arbitrary but stable determination.

func (ActivityStreamsLink) Serialize

func (this ActivityStreamsLink) Serialize() (map[string]interface{}, error)

Serialize converts this into an interface representation suitable for marshalling into a text or binary format.

func (*ActivityStreamsLink) SetActivityStreamsAttributedTo

func (this *ActivityStreamsLink) SetActivityStreamsAttributedTo(i vocab.ActivityStreamsAttributedToProperty)

SetActivityStreamsAttributedTo sets the "attributedTo" property.

func (*ActivityStreamsLink) SetActivityStreamsHeight

func (this *ActivityStreamsLink) SetActivityStreamsHeight(i vocab.ActivityStreamsHeightProperty)

SetActivityStreamsHeight sets the "height" property.

func (*ActivityStreamsLink) SetActivityStreamsHref

func (this *ActivityStreamsLink) SetActivityStreamsHref(i vocab.ActivityStreamsHrefProperty)

SetActivityStreamsHref sets the "href" property.

func (*ActivityStreamsLink) SetActivityStreamsHreflang

func (this *ActivityStreamsLink) SetActivityStreamsHreflang(i vocab.ActivityStreamsHreflangProperty)

SetActivityStreamsHreflang sets the "hreflang" property.

func (*ActivityStreamsLink) SetActivityStreamsMediaType

func (this *ActivityStreamsLink) SetActivityStreamsMediaType(i vocab.ActivityStreamsMediaTypeProperty)

SetActivityStreamsMediaType sets the "mediaType" property.

func (*ActivityStreamsLink) SetActivityStreamsName

func (this *ActivityStreamsLink) SetActivityStreamsName(i vocab.ActivityStreamsNameProperty)

SetActivityStreamsName sets the "name" property.

func (*ActivityStreamsLink) SetActivityStreamsPreview

func (this *ActivityStreamsLink) SetActivityStreamsPreview(i vocab.ActivityStreamsPreviewProperty)

SetActivityStreamsPreview sets the "preview" property.

func (*ActivityStreamsLink) SetActivityStreamsRel

func (this *ActivityStreamsLink) SetActivityStreamsRel(i vocab.ActivityStreamsRelProperty)

SetActivityStreamsRel sets the "rel" property.

func (*ActivityStreamsLink) SetActivityStreamsSummary

func (this *ActivityStreamsLink) SetActivityStreamsSummary(i vocab.ActivityStreamsSummaryProperty)

SetActivityStreamsSummary sets the "summary" property.

func (*ActivityStreamsLink) SetActivityStreamsWidth

func (this *ActivityStreamsLink) SetActivityStreamsWidth(i vocab.ActivityStreamsWidthProperty)

SetActivityStreamsWidth sets the "width" property.

func (*ActivityStreamsLink) SetJSONLDId

func (this *ActivityStreamsLink) SetJSONLDId(i vocab.JSONLDIdProperty)

SetJSONLDId sets the "id" property.

func (*ActivityStreamsLink) SetJSONLDType

func (this *ActivityStreamsLink) SetJSONLDType(i vocab.JSONLDTypeProperty)

SetJSONLDType sets the "type" property.

func (ActivityStreamsLink) VocabularyURI

func (this ActivityStreamsLink) VocabularyURI() string

VocabularyURI returns the vocabulary's URI as a string.

Jump to

Keyboard shortcuts

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