versia-go/pkg/versia/entity.go

27 lines
676 B
Go
Raw Permalink 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-28 00:25:25 +02:00
versiautils "github.com/versia-pub/versia-go/pkg/versia/utils"
2024-08-11 03:51:22 +02:00
)
2024-08-28 00:25:25 +02:00
// Entity is the base type for all Versia entities. For more information, see the [Spec].
2024-08-11 03:51:22 +02:00
//
2024-08-28 00:25:25 +02:00
// [Spec]: https://versia.pub/entities
2024-08-11 03:51:22 +02:00
type Entity struct {
// ID is a UUID for the entity
ID uuid.UUID `json:"id"`
2024-08-28 00:25:25 +02:00
// Type is the type of the entity
Type string `json:"type"`
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
2024-08-28 00:25:25 +02:00
// URI is the URL to the entity
URI *versiautils.URL `json:"uri"`
// Extensions is a map of active extensions for the entity
2024-08-11 03:51:22 +02:00
Extensions Extensions `json:"extensions,omitempty"`
}