Documentation
¶
Index ¶
- type ContributionVO
- type LicenseVO
- type LicenseVersionVO
- type PersonVO
- type PersonVersionVO
- type PublisherVO
- type PublisherVersionVO
- type ReviewVO
- type StudioVO
- type StudioVersionVO
- type SystemVO
- type SystemVersionVO
- type VersionLifecycleVO
- type VersionState
- type VolumeMetaVO
- type VolumeVO
- type VolumeVersionVO
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContributionVO ¶
type ContributionVO struct {
ID string `json:"id" jsonapi:"primary,contribution"`
Person *PersonVO `json:"person,omitempty" jsonapi:"relation,person,omitempty"`
Volume *VolumeVO `json:"volume,omitempty" jsonapi:"relation,volume,omitempty"`
Role string `jsonapi:"attr,role"`
Notes string `json:"notes" jsonapi:"attr,notes"`
modelcore.AuditableVO
}
Contribution value object. This value object is a serializable representation of the Contribution model.
type LicenseVO ¶
type LicenseVO struct {
ID string `json:"id" jsonapi:"primary,license"`
Title string `json:"title" jsonapi:"attr,title"`
ShortTitle string `json:"short_title" jsonapi:"attr,short_title"`
Version string `json:"version" jsonapi:"attr,version"`
Deed string `json:"deed" jsonapi:"attr,deed"`
LegalCode string `json:"legal_code" jsonapi:"attr,legal_code"`
Website string `json:"website" jsonapi:"attr,website"`
Status string `json:"status" jsonapi:"attr,status"`
Availability string `json:"availability" jsonapi:"attr,availability"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
modelcore.AuditableVO
}
License value object. This value object is a serializable representation of the License model.
Website is a plain string, not url.URL - see PublisherVO's comment.
type LicenseVersionVO ¶ added in v0.4.0
type LicenseVersionVO struct {
ID string `json:"id" jsonapi:"primary,license_version"`
RecordID string `json:"recordId" jsonapi:"attr,record_id"`
Version int `json:"version" jsonapi:"attr,version"`
Title string `json:"title" jsonapi:"attr,title"`
ShortTitle string `json:"shortTitle" jsonapi:"attr,short_title"`
LicenseVer string `json:"licenseVersion" jsonapi:"attr,license_version"`
Deed string `json:"deed" jsonapi:"attr,deed"`
LegalCode string `json:"legalCode" jsonapi:"attr,legal_code"`
Website string `json:"website" jsonapi:"attr,website"`
Status string `json:"status" jsonapi:"attr,status"`
Availability string `json:"availability" jsonapi:"attr,availability"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
VersionLifecycleVO
}
LicenseVersionVO value object - see models.LicenseVersion. Note the internal model field LicenseVer/version_label maps back onto this VO's Version/"version" - the public read shape is unaffected by the internal rename needed to avoid colliding with the version record's own Version int field. Website is a plain string, not url.URL - see PublisherVO's comment.
type PersonVO ¶
type PersonVO struct {
ID string `json:"id" jsonapi:"primary,person"`
Name string `json:"name" jsonapi:"attr,name"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
modelcore.AuditableVO
}
Person value object. This value object is a serializable representation of the Person model.
type PersonVersionVO ¶ added in v0.4.0
type PersonVersionVO struct {
ID string `json:"id" jsonapi:"primary,person_version"`
RecordID string `json:"recordId" jsonapi:"attr,record_id"`
Version int `json:"version" jsonapi:"attr,version"`
Name string `json:"name" jsonapi:"attr,name"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
VersionLifecycleVO
}
PersonVersionVO value object - see models.PersonVersion.
type PublisherVO ¶
type PublisherVO struct {
ID string `json:"id" jsonapi:"primary,publisher"`
Name string `json:"name" jsonapi:"attr,name"`
Address string `json:"address" jsonapi:"attr,address"`
Website string `json:"website" jsonapi:"attr,website"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
modelcore.AuditableVO
}
Publisher value object. This value object is a serializable representation of the Publisher model.
Website is a plain string, not url.URL - url.URL has no MarshalJSON, so jsonapi previously serialized it as its internal struct fields (Scheme/Host/Path/...) instead of a URL string, breaking every non-Go client.
type PublisherVersionVO ¶ added in v0.4.0
type PublisherVersionVO struct {
ID string `json:"id" jsonapi:"primary,publisher_version"`
RecordID string `json:"recordId" jsonapi:"attr,record_id"`
Version int `json:"version" jsonapi:"attr,version"`
Name string `json:"name" jsonapi:"attr,name"`
Address string `json:"address" jsonapi:"attr,address"`
Website string `json:"website" jsonapi:"attr,website"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
VersionLifecycleVO
}
PublisherVersionVO value object - see models.PublisherVersion. Website is a plain string, not url.URL - see PublisherVO's comment.
type ReviewVO ¶
type ReviewVO struct {
ID string `json:"id" jsonapi:"primary,review"`
Title string `json:"title" jsonapi:"attr,title"`
Body string `json:"body" jsonapi:"attr,body"`
Language string `json:"language" jsonapi:"attr,language"`
Volume *VolumeVO `json:"volume" jsonapi:"relation,volume"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
modelcore.AuditableVO
}
Review value object. This value object is a serializable representation of the Review model.
type StudioVO ¶
type StudioVO struct {
ID string `json:"id" jsonapi:"primary,studio"`
Name string `json:"name" jsonapi:"attr,name"`
Website string `json:"website" jsonapi:"attr,website"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
modelcore.AuditableVO
}
Studio value object. This value object is a serializable representation of the Studio model.
Website is a plain string, not url.URL - see PublisherVO's comment.
type StudioVersionVO ¶ added in v0.4.0
type StudioVersionVO struct {
ID string `json:"id" jsonapi:"primary,studio_version"`
RecordID string `json:"recordId" jsonapi:"attr,record_id"`
Version int `json:"version" jsonapi:"attr,version"`
Name string `json:"name" jsonapi:"attr,name"`
Website string `json:"website" jsonapi:"attr,website"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
VersionLifecycleVO
}
StudioVersionVO value object - see models.StudioVersion. Website is a plain string, not url.URL - see PublisherVO's comment.
type SystemVO ¶
type SystemVO struct {
ID string `json:"id" jsonapi:"primary,system"`
// GameSystem holds the game system's display name (e.g. "Dungeons & Dragons") - tagged
// "name" on the wire, not "game_system", so catalog-api-client.swift's generic
// NamedAttributes decoder (name ?? title ?? "Untitled") picks it up the same way it
// already does for Publisher/Studio/Person/License.
GameSystem string `json:"game_system" jsonapi:"attr,name"`
Edition string `json:"edition" jsonapi:"attr,edition"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
modelcore.AuditableVO
}
System value object. This value object is a serializable representation of the System model.
type SystemVersionVO ¶ added in v0.4.0
type SystemVersionVO struct {
ID string `json:"id" jsonapi:"primary,system_version"`
RecordID string `json:"recordId" jsonapi:"attr,record_id"`
Version int `json:"version" jsonapi:"attr,version"`
GameSystem string `json:"gameSystem" jsonapi:"attr,game_system"`
Edition string `json:"edition" jsonapi:"attr,edition"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
VersionLifecycleVO
}
SystemVersionVO value object - see models.SystemVersion.
type VersionLifecycleVO ¶ added in v0.4.0
type VersionLifecycleVO struct {
State VersionState `json:"state" jsonapi:"attr,state"`
BaseVersion *int `json:"baseVersion,omitempty" jsonapi:"attr,base_version,omitempty"`
SubmittedBy string `json:"submittedBy" jsonapi:"attr,submitted_by"`
SubmittedAt time.Time `json:"submittedAt" jsonapi:"attr,submitted_at"`
ReviewedBy *string `json:"reviewedBy,omitempty" jsonapi:"attr,reviewed_by,omitempty"`
ReviewedAt *time.Time `json:"reviewedAt,omitempty" jsonapi:"attr,reviewed_at,omitempty"`
ReviewNote *string `json:"reviewNote,omitempty" jsonapi:"attr,review_note,omitempty"`
ResultingVersion *int `json:"resultingVersion,omitempty" jsonapi:"attr,resulting_version,omitempty"`
}
VersionLifecycleVO mirrors models.VersionLifecycle - see that type's doc comment.
type VersionState ¶ added in v0.3.0
type VersionState string
VersionState is the lifecycle state of a version record, shared across every versioned entity type (volume, publisher, studio, person, license, system).
const ( VersionStateSubmitted VersionState = "submitted" VersionStateLive VersionState = "live" VersionStateArchived VersionState = "archived" VersionStateRejected VersionState = "rejected" VersionStatePartiallyAccepted VersionState = "partially_accepted" VersionStateWithdrawn VersionState = "withdrawn" )
type VolumeMetaVO ¶ added in v0.3.0
type VolumeMetaVO struct {
ID string `json:"id" jsonapi:"primary,volume_meta"`
CurrentVersion int `json:"currentVersion" jsonapi:"attr,current_version"`
CreatedAt time.Time `json:"createdAt" jsonapi:"attr,created_at"`
CreatedBy string `json:"createdBy" jsonapi:"attr,created_by"`
UpdatedAt time.Time `json:"updatedAt" jsonapi:"attr,updated_at"`
UpdatedBy string `json:"updatedBy" jsonapi:"attr,updated_by"`
DeletedAt *time.Time `json:"deletedAt,omitempty" jsonapi:"attr,deleted_at,omitempty"`
DeletedBy *string `json:"deletedBy,omitempty" jsonapi:"attr,deleted_by,omitempty"`
}
VolumeMeta value object. This value object is a serializable representation of the VolumeMeta model.
type VolumeVO ¶
type VolumeVO struct {
ID string `json:"id" jsonapi:"primary,volume"`
Title string `json:"title" jsonapi:"attr,title"`
Description string `json:"description" jsonapi:"attr,description"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Format string `json:"format" jsonapi:"attr,format"`
CoverAssetId string `json:"coverAssetId" jsonapi:"attr,coverAssetId"`
SampleAssetIds []string `json:"sampleAssetIds" jsonapi:"attr,sampleAssetIds"`
Systems []*SystemVO `json:"systems" jsonapi:"relation,system"`
// SystemTitles: denormalized system display names keyed by system ID. On a read it carries
// the stored snapshot; on a write it is an advisory hint (catalog-api overwrites it from an
// authoritative game-systems-api lookup when reachable).
SystemTitles map[string]string `json:"systemTitles,omitempty" jsonapi:"attr,systemTitles,omitempty"`
Publishers []*PublisherVO `json:"publishers" jsonapi:"relation,publisher"`
Studios []*StudioVO `json:"studios" jsonapi:"relation,studio"`
Licenses []*LicenseVO `json:"licenses" jsonapi:"relation,license"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
modelcore.AuditableVO
}
Volume value object. This value object is a serializable representation of the Volume model.
Systems/Publishers/Studios/Licenses are pointer slices, not value slices - the jsonapi library's relationship marshaling (visitModelNode, called recursively per relationship element) requires each element to be a pointer; passed a value type, reflect.Value.IsNil panics rather than returning an error. This never surfaced before because no Volume's relationships were ever actually populated through the write path until durable-volume-editing's publisher/studio linking exercised it for the first time.
type VolumeVersionVO ¶ added in v0.3.0
type VolumeVersionVO struct {
ID string `json:"id" jsonapi:"primary,volume_version"`
RecordID string `json:"recordId" jsonapi:"attr,record_id"`
Version int `json:"version" jsonapi:"attr,version"`
Title string `json:"title" jsonapi:"attr,title"`
Description string `json:"description" jsonapi:"attr,description"`
Notes string `json:"notes" jsonapi:"attr,notes"`
Format string `json:"format" jsonapi:"attr,format"`
CoverAssetId string `json:"coverAssetId" jsonapi:"attr,coverAssetId"`
SampleAssetIds []string `json:"sampleAssetIds" jsonapi:"attr,sampleAssetIds"`
// StagedCoverAssetId/StagedSampleAssetIds mirror VolumeVersion's staged fields - see that
// model's doc comment.
StagedCoverAssetId *string `json:"stagedCoverAssetId,omitempty" jsonapi:"attr,staged_cover_asset_id,omitempty"`
StagedSampleAssetIds []string `json:"stagedSampleAssetIds,omitempty" jsonapi:"attr,staged_sample_asset_ids,omitempty"`
Systems []*SystemVO `json:"systems" jsonapi:"relation,system"`
// SystemTitles: denormalized system display names keyed by system ID - see VolumeVO.
SystemTitles map[string]string `json:"systemTitles,omitempty" jsonapi:"attr,systemTitles,omitempty"`
Publishers []*PublisherVO `json:"publishers" jsonapi:"relation,publisher"`
Studios []*StudioVO `json:"studios" jsonapi:"relation,studio"`
Licenses []*LicenseVO `json:"licenses" jsonapi:"relation,license"`
Properties []modelcore.PropertyVO `json:"properties" jsonapi:"attr,properties"`
Tags []modelcore.TagVO `json:"tags" jsonapi:"attr,tags"`
State VersionState `json:"state" jsonapi:"attr,state"`
BaseVersion *int `json:"baseVersion,omitempty" jsonapi:"attr,base_version,omitempty"`
SubmittedBy string `json:"submittedBy" jsonapi:"attr,submitted_by"`
SubmittedAt time.Time `json:"submittedAt" jsonapi:"attr,submitted_at"`
ReviewedBy *string `json:"reviewedBy,omitempty" jsonapi:"attr,reviewed_by,omitempty"`
ReviewedAt *time.Time `json:"reviewedAt,omitempty" jsonapi:"attr,reviewed_at,omitempty"`
ReviewNote *string `json:"reviewNote,omitempty" jsonapi:"attr,review_note,omitempty"`
ResultingVersion *int `json:"resultingVersion,omitempty" jsonapi:"attr,resulting_version,omitempty"`
}
VolumeVersion value object. This value object is a serializable representation of the VolumeVersion model.