feat: initial commit
This commit is contained in:
commit
a161b86c9a
705 changed files with 288162 additions and 0 deletions
57
vendor/sourcery.dny.nu/pana/icon.go
vendored
Normal file
57
vendor/sourcery.dny.nu/pana/icon.go
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
package pana
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
ld "sourcery.dny.nu/longdistance"
|
||||
as "sourcery.dny.nu/pana/vocab/w3/activitystreams"
|
||||
)
|
||||
|
||||
// Icon is a more constrained version of [Image] used with [as.Icon].
|
||||
type Icon Image
|
||||
|
||||
// NewIcon initialises a new Icon.
|
||||
func NewIcon() *Icon {
|
||||
return &Icon{
|
||||
Properties: make(ld.Properties),
|
||||
Type: []string{as.TypeImage},
|
||||
}
|
||||
}
|
||||
|
||||
// Build finalises the Icon.
|
||||
func (i *Icon) Build() Icon {
|
||||
return *i
|
||||
}
|
||||
|
||||
// See [Object.GetType].
|
||||
func (i *Icon) GetType() string {
|
||||
return (*Image)(i).GetType()
|
||||
}
|
||||
|
||||
// See [Object.SetType].
|
||||
func (i *Icon) SetType() *Icon {
|
||||
(*Image)(i).SetType(as.TypeImage)
|
||||
return i
|
||||
}
|
||||
|
||||
// GetMediaType returns the value in [as.MediaType].
|
||||
func (i *Icon) GetMediaType() json.RawMessage {
|
||||
return (*Image)(i).GetMediaType()
|
||||
}
|
||||
|
||||
// SetMediaType sets the value in [as.MediaType].
|
||||
func (i *Icon) SetMediaType(v json.RawMessage) *Icon {
|
||||
(*Image)(i).SetMediaType(v)
|
||||
return i
|
||||
}
|
||||
|
||||
// See [Object.GetURL].
|
||||
func (i *Icon) GetURL() string {
|
||||
return (*Image)(i).GetURL()
|
||||
}
|
||||
|
||||
// See [Object.SetURL].
|
||||
func (i *Icon) SetURL(url string) *Icon {
|
||||
(*Image)(i).SetURL(url)
|
||||
return i
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue