Documentation ¶
Overview ¶
Provides structure for API dump history.
Index ¶
- func Actions(update *Update) []diff.Action
- func SortChanges(changes []*Change)
- func VisitTags(hist *Root, visit func(tag string) (next string, ok bool))
- type Change
- type Cursor
- type Object
- type Root
- func (r *Root) AppendUpdate(build archive.Build, actions []diff.Action, prevRoot *rbxdump.Root)
- func (r Root) EarliestUpdate() (update *Update)
- func (r Root) LatestUpdate() (update *Update)
- func (r *Root) MarshalJSON() (b []byte, err error)
- func (r *Root) UnmarshalJSON(b []byte) error
- func (r Root) UpdateRange(start, end time.Time) (updates []*Update)
- type TypeRef
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SortChanges ¶
func SortChanges(changes []*Change)
Sorts a list of change IDs by the corresponding date.
Types ¶
type Change ¶
type Change struct { // The index of the update in Root.Update that caused this change. Update *Update // The change that occurred. Action diff.Action // The previous values before the change was made. Prev rbxdump.Fields }
Represents one unit of change.
type Cursor ¶
Uses an update chain to generate an in-place API dump.
func (*Cursor) Roll ¶
Rolls the cursor's current target forward or backward until it hits target. Returns false if target is nil, or target is not in the chain of c.Target. If c.Target is nil, the cursor rolls from the start of target's chain, until it reaches target. If true is returned, then c.Dump has been patched to represent the state of the target update.
type Object ¶
type Object struct { // Maps class ID to changes. Class map[id.Class][]*Change // Maps member ID to changes. Member map[id.MemberID][]*Change // Maps enum ID to changes. Enum map[id.Enum][]*Change // Maps enum item ID to changes. EnumItem map[id.EnumItemID][]*Change // Maps type ID to type references. Type map[id.Type][]*TypeRef }
Maps an object to a list of changes that apply to the object.
type Root ¶
type Root struct { // Objects per type. Object Object // List of all changes. Change []*Change // List of all updates. Update []*Update }
Entrypoint to history structure.
func (*Root) AppendUpdate ¶
Appends an update derived from the given build and actions. The latest update is assumed to be the previous.
All maps in the Root are expected to be non-nil.
func (Root) EarliestUpdate ¶
Returns the earliest update, or zero if there are no updates.
func (Root) LatestUpdate ¶
Returns the latest update, or zero if there are no updates.
func (*Root) MarshalJSON ¶
func (*Root) UnmarshalJSON ¶
type TypeRef ¶
type TypeRef struct { Change *Change // The associated change. Prev bool // true: Change.Prev; false: Change.Action.Fields. Field string // Index of Fields. Type string // Type: rbxdump.Type; Parameter: rbxdump.Parameter. Index int // Index within slice value. -1: Not a slice. Value rbxdump.Type // The type itself. }
Refers to a Type that appears within a Change.
type Update ¶
type Update struct { // The previous update, from which this update's changes were based on. May // be nil. Prev *Update // The next update. May be nil. Next *Update // Time when the update occurred. Date time.Time // Version ID string (version-0123456789abcdef). GUID string // Version number. Version rbxver.Version // List of changes that occurred during the update. Changes []*Change }
Represents an update that caused a number of changes.