rbxdump

package module
Version: v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2021 License: MIT Imports: 2 Imported by: 3

README

GoDoc

rbxdump

The rbxdump package is a Go package used to serialize Roblox Lua API dumps.

API References

  • rbxdump
    • diff: Provides operations for diffing and patching rbxdump structures.
    • json: Serializes between rbxdump and the JSON dump format.
    • legacy: Serializes between rbxdump and the legacy dump format.

Documentation

Overview

The rbxdump package is used to represent Roblox Lua API dumps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback struct {
	Name         string
	Parameters   []Parameter
	ReturnType   Type
	Security     string
	ThreadSafety string
	Tags
}

Callback is a Member that represents a class callback.

func (*Callback) Copy added in v0.2.0

func (member *Callback) Copy() *Callback

Copy returns a deep copy of the callback.

func (*Callback) Fields added in v0.2.0

func (member *Callback) Fields() Fields

Fields implements the Fielder interface.

func (*Callback) MemberCopy added in v0.2.0

func (member *Callback) MemberCopy() Member

MemberCopy returns a deep copy of the member.

MemberType implements the Member interface.

func (*Callback) MemberName added in v0.2.0

func (member *Callback) MemberName() string

MemberName returns the name of the member.

MemberType implements the Member interface.

func (*Callback) MemberType added in v0.2.0

func (member *Callback) MemberType() string

MemberType returns a string indicating the the type of member.

MemberType implements the Member interface.

func (*Callback) SetFields added in v0.2.0

func (member *Callback) SetFields(fields Fields)

SetFields implements the Fielder interface.

type Class

type Class struct {
	Name           string
	Superclass     string
	MemoryCategory string
	Members        map[string]Member
	Tags
}

Class represents a class defined in an API dump.

func (*Class) Copy

func (class *Class) Copy() *Class

Copy returns a deep copy of the class.

func (*Class) Fields added in v0.2.0

func (class *Class) Fields() Fields

Fields implements the Fielder interface. Does not return the Members field.

func (*Class) GetMembers

func (class *Class) GetMembers() []Member

GetMembers returns a list of members belonging to the class, sorted by name.

func (*Class) SetFields added in v0.2.0

func (class *Class) SetFields(fields Fields)

SetFields implements the Fielder interface.

type Enum

type Enum struct {
	Name  string
	Items map[string]*EnumItem
	Tags
}

Enum represents an enum defined in an API dump.

func (*Enum) Copy

func (enum *Enum) Copy() *Enum

Copy returns a deep copy of the enum.

func (*Enum) Fields added in v0.2.0

func (enum *Enum) Fields() Fields

Fields implements the Fielder interface. Does not return the Items field.

func (*Enum) GetEnumItems

func (enum *Enum) GetEnumItems() []*EnumItem

GetEnumItems returns a list of items of the enum.

func (*Enum) SetFields added in v0.2.0

func (enum *Enum) SetFields(fields Fields)

SetFields implements the Fielder interface.

type EnumItem

type EnumItem struct {
	Name  string
	Value int
	Index int // Index determines the item's order among its sibling items.
	Tags
}

EnumItem represents an enum item.

func (*EnumItem) Copy

func (item *EnumItem) Copy() *EnumItem

Copy returns a deep copy of the enum item.

func (*EnumItem) Fields added in v0.2.0

func (item *EnumItem) Fields() Fields

Fields implements the Fielder interface.

func (*EnumItem) SetFields added in v0.2.0

func (item *EnumItem) SetFields(fields Fields)

SetFields implements the Fielder interface.

type Event

type Event struct {
	Name         string
	Parameters   []Parameter
	Security     string
	ThreadSafety string
	Tags
}

Event is a Member that represents a class event.

func (*Event) Copy added in v0.2.0

func (member *Event) Copy() *Event

Copy returns a deep copy of the event.

func (*Event) Fields added in v0.2.0

func (member *Event) Fields() Fields

Fields implements the Fielder interface.

func (*Event) MemberCopy added in v0.2.0

func (member *Event) MemberCopy() Member

MemberCopy returns a deep copy of the member.

MemberType implements the Member interface.

func (*Event) MemberName added in v0.2.0

func (member *Event) MemberName() string

MemberName returns the name of the member.

MemberType implements the Member interface.

func (*Event) MemberType added in v0.2.0

func (member *Event) MemberType() string

MemberType returns a string indicating the the type of member.

MemberType implements the Member interface.

func (*Event) SetFields added in v0.2.0

func (member *Event) SetFields(fields Fields)

SetFields implements the Fielder interface.

type Fielder added in v0.2.0

type Fielder interface {
	// Fields returns the set of fields present in the value. Values may be
	// retained by the implementation.
	Fields() Fields
	// SetFields sets the fields of the value. Values must not be retained; they
	// should be copied if necessary. Invalid fields are ignored.
	SetFields(Fields)
}

Fielder is implemented by any value that can get and set its fields from a Fields map.

type Fields added in v0.2.0

type Fields map[string]interface{}

Fields describes a set of names mapped to values.

func (*Fields) UnmarshalJSON added in v0.3.2

func (f *Fields) UnmarshalJSON(b []byte) (err error)

type Function

type Function struct {
	Name         string
	Parameters   []Parameter
	ReturnType   Type
	Security     string
	ThreadSafety string
	Tags
}

Function is a Member that represents a class function.

func (*Function) Copy added in v0.2.0

func (member *Function) Copy() *Function

Copy returns a deep copy of the function.

func (*Function) Fields added in v0.2.0

func (member *Function) Fields() Fields

Fields implements the Fielder interface.

func (*Function) MemberCopy added in v0.2.0

func (member *Function) MemberCopy() Member

MemberCopy returns a deep copy of the member.

MemberType implements the Member interface.

func (*Function) MemberName added in v0.2.0

func (member *Function) MemberName() string

MemberName returns the name of the member.

MemberType implements the Member interface.

func (*Function) MemberType added in v0.2.0

func (member *Function) MemberType() string

MemberType returns a string indicating the the type of member.

MemberType implements the Member interface.

func (*Function) SetFields added in v0.2.0

func (member *Function) SetFields(fields Fields)

SetFields implements the Fielder interface.

type Member

type Member interface {
	Fielder
	Tagger

	// MemberType returns a string indicating the type of member.
	MemberType() string
	// MemberName returns the name of the member.
	MemberName() string
	// MemberCopy returns a deep copy of the member.
	MemberCopy() Member
	// contains filtered or unexported methods
}

Member represents a member of a Class.

type Parameter

type Parameter struct {
	Type     Type
	Name     string
	Optional bool
	Default  string
}

Parameter represents a parameter of a function, event, or callback member.

func CopyParams added in v0.2.0

func CopyParams(p []Parameter) []Parameter

CopyParams returns a copy of the given parameters.

type Property

type Property struct {
	Name          string
	ValueType     Type
	Category      string
	ReadSecurity  string
	WriteSecurity string
	CanLoad       bool
	CanSave       bool
	ThreadSafety  string
	Tags
}

Property is a Member that represents a class property.

func (*Property) Copy added in v0.2.0

func (member *Property) Copy() *Property

Copy returns a deep copy of the property.

func (*Property) Fields added in v0.2.0

func (member *Property) Fields() Fields

Fields implements the Fielder interface.

func (*Property) MemberCopy added in v0.2.0

func (member *Property) MemberCopy() Member

MemberCopy returns a deep copy of the member.

MemberType implements the Member interface.

func (*Property) MemberName added in v0.2.0

func (member *Property) MemberName() string

MemberName returns the name of the member.

MemberType implements the Member interface.

func (*Property) MemberType added in v0.2.0

func (member *Property) MemberType() string

MemberType returns a string indicating the the type of member.

MemberType implements the Member interface.

func (*Property) SetFields added in v0.2.0

func (member *Property) SetFields(fields Fields)

SetFields implements the Fielder interface.

type Root

type Root struct {
	Classes map[string]*Class
	Enums   map[string]*Enum
}

Root represents the top-level structure of an API dump.

func (*Root) Copy

func (root *Root) Copy() *Root

Copy returns a deep copy of the root.

func (*Root) Fields added in v0.2.0

func (root *Root) Fields() Fields

Fields implements the Fielder interface.

func (*Root) GetClasses

func (root *Root) GetClasses() []*Class

GetClasses returns the Classes in the root as a slice, ordered by name.

func (*Root) GetEnums

func (root *Root) GetEnums() []*Enum

GetEnums returns the Enums in the root as a slice, ordered by name.

func (*Root) SetFields added in v0.2.0

func (root *Root) SetFields(fields Fields)

SetFields implements the Fielder interface.

type Tagger added in v0.2.0

type Tagger interface {
	// GetTag returns whether the given tag is present.
	GetTag(tag string) bool
	// GetTags returns a list of all present tags. Implementations must not
	// retain the result.
	GetTags() []string
	// SetTag adds one or more tags. Duplicate tags are removed.
	SetTag(tag ...string)
	// UnsetTag removes one or more tags. Duplicate tags are removed.
	UnsetTag(tag ...string)
}

Tagger is implemented by any value that contains a set of tags.

type Tags added in v0.2.0

type Tags []string

Tags implements a Tagger, to be embedded by taggable elements.

func (Tags) GetTag added in v0.2.0

func (tags Tags) GetTag(tag string) bool

GetTag returns whether the given tag is present.

func (Tags) GetTags added in v0.2.0

func (tags Tags) GetTags() []string

GetTags returns a list of all present tags.

func (*Tags) SetTag added in v0.2.0

func (tags *Tags) SetTag(tag ...string)

SetTag adds one or more tags. Duplicate tags are removed.

func (*Tags) UnsetTag added in v0.2.0

func (tags *Tags) UnsetTag(tag ...string)

UnsetTag removes one or more tags. Duplicate tags are removed.

type Type

type Type struct {
	Category string
	Name     string
}

Type represents a value type.

func (Type) String

func (typ Type) String() string

String returns a string representation of the type.

Source Files

Directories

Path Synopsis
The diff package provides operations for diffing and patching rbxdump structures.
The diff package provides operations for diffing and patching rbxdump structures.
The histlog package is used to parse logs involving the deployment of Roblox builds.
The histlog package is used to parse logs involving the deployment of Roblox builds.
The json package is used to serialize between rbxdump and Roblox JSON API dump format.
The json package is used to serialize between rbxdump and Roblox JSON API dump format.
The legacy package is used to serialize between rbxdump and Roblox legacy API dump format.
The legacy package is used to serialize between rbxdump and Roblox legacy API dump format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL