versia-go/pkg/versia/entity.go

45 lines
1.1 KiB
Go
Raw Normal View History

2024-08-22 23:03:38 +02:00
package versia
2024-08-11 03:51:22 +02:00
import (
"github.com/google/uuid"
2024-08-22 23:03:38 +02:00
versiautils "github.com/lysand-org/versia-go/pkg/versia/utils"
2024-08-11 03:51:22 +02:00
)
// Entity is the base type for all Lysand entities. For more information, see the [Spec].
//
// [Spec]: https://lysand.org/objects#types
type Entity struct {
// Type is the type of the entity
Type string `json:"type"`
// ID is a UUID for the entity
ID uuid.UUID `json:"id"`
// URI is the URL to the entity
2024-08-22 23:03:38 +02:00
URI *versiautils.URL `json:"uri"`
2024-08-11 03:51:22 +02:00
// CreatedAt is the time the entity was created
2024-08-22 23:03:38 +02:00
CreatedAt versiautils.Time `json:"created_at"`
2024-08-11 03:51:22 +02:00
// Extensions is a map of active extensions
// https://lysand.org/objects/server-metadata#extensions
Extensions Extensions `json:"extensions,omitempty"`
}
type Extensions map[string]any
// {
// "org.lysand:custom_emojis": {
// "emojis": [
// {
// "name": "neocat_3c",
// "url": {
// "image/webp": {
// "content": "https://cdn.lysand.org/a97727158bf062ad31cbfb02e212ce0c7eca599a2f863276511b8512270b25e8/neocat_3c_256.webp"
// }
// }
// }
// ]
// }
// }