Documentation ¶
Overview ¶
The rbxapijson package implements the rbxapi package as a codec for the Roblox API dump in JSON format.
Note that this package is an implementation of a non-standardized format. Therefore, this package's API is subject to change as the format changes.
Index ¶
- func Encode(w io.Writer, root *Root) (err error)
- type Callback
- func (member *Callback) Copy() rbxapi.Member
- func (member *Callback) GetMemberType() string
- func (member *Callback) GetName() string
- func (member *Callback) GetParameters() rbxapi.Parameters
- func (member *Callback) GetReturnType() rbxapi.Type
- func (member *Callback) GetSecurity() string
- func (member *Callback) Patch(actions []patch.Action)
- type Class
- func (class *Class) Copy() rbxapi.Class
- func (class *Class) GetMember(name string) rbxapi.Member
- func (class *Class) GetMembers() []rbxapi.Member
- func (class *Class) GetName() string
- func (class *Class) GetSuperclass() string
- func (class *Class) MarshalJSON() (b []byte, err error)
- func (class *Class) Patch(actions []patch.Action)
- func (class *Class) UnmarshalJSON(b []byte) (err error)
- type Diff
- type DiffCallback
- type DiffClass
- type DiffEnum
- type DiffEnumItem
- type DiffEvent
- type DiffFunction
- type DiffProperty
- type Enum
- type EnumItem
- type Event
- type Function
- func (member *Function) Copy() rbxapi.Member
- func (member *Function) GetMemberType() string
- func (member *Function) GetName() string
- func (member *Function) GetParameters() rbxapi.Parameters
- func (member *Function) GetReturnType() rbxapi.Type
- func (member *Function) GetSecurity() string
- func (member *Function) Patch(actions []patch.Action)
- type Parameter
- func (param Parameter) Copy() rbxapi.Parameter
- func (param Parameter) GetDefault() (value string, ok bool)
- func (param Parameter) GetName() string
- func (param Parameter) GetType() rbxapi.Type
- func (param *Parameter) MarshalJSON() (b []byte, err error)
- func (param *Parameter) UnmarshalJSON(b []byte) (err error)
- type Parameters
- type Property
- type Root
- func (root *Root) Copy() rbxapi.Root
- func (root *Root) GetClass(name string) rbxapi.Class
- func (root *Root) GetClasses() []rbxapi.Class
- func (root *Root) GetEnum(name string) rbxapi.Enum
- func (root *Root) GetEnums() []rbxapi.Enum
- func (root *Root) MarshalJSON() (b []byte, err error)
- func (root *Root) Patch(actions []patch.Action)
- func (root *Root) UnmarshalJSON(b []byte) (err error)
- type Tags
- type Type
- type VersionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callback ¶
type Callback struct { Name string Parameters []Parameter ReturnType Type Security string Tags `json:",omitempty"` }
Callback represents a class member of the Callback member type.
func (*Callback) Copy ¶
Copy returns a deep copy of the member descriptor.
Copy implements the rbxapi.Member interface.
func (*Callback) GetMemberType ¶
GetMemberType returns a string indicating the the type of member.
GetMemberType implements the rbxapi.Member interface.
func (*Callback) GetName ¶
GetName returns the name of the member.
GetName implements the rbxapi.Member interface.
func (*Callback) GetParameters ¶
func (member *Callback) GetParameters() rbxapi.Parameters
GetParameters returns the list of parameters describing the arguments passed to the callback. These parameters cannot have default values.
GetParameters implements the rbxapi.Callback interface.
func (*Callback) GetReturnType ¶
GetReturnType returns the type of value that is returned by the callback.
GetReturnType implements the rbxapi.Callback interface.
func (*Callback) GetSecurity ¶
GetSecurity returns the security context of the member's access.
GetSecurity implements the rbxapi.Callback interface.
type Class ¶
type Class struct { Name string Superclass string MemoryCategory string Members []rbxapi.Member Tags `json:",omitempty"` }
Class represents a class descriptor.
func (*Class) Copy ¶
Copy returns a deep copy of the class descriptor.
Copy implements the rbxapi.Class interface.
func (*Class) GetMember ¶
GetMember returns the first member descriptor of the given name, or nil if no member of the given name is present.
GetMember implements the rbxapi.Class interface.
func (*Class) GetMembers ¶
GetMembers returns a list of member descriptors belonging to the class.
GetMembers implements the rbxapi.Class interface.
func (*Class) GetName ¶
GetName returns the class name.
GetName implements the rbxapi.Class interface.
func (*Class) GetSuperclass ¶
GetSuperclass returns the name of the class that this class inherits from.
GetSuperclass implements the rbxapi.Class interface.
func (*Class) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface.
func (*Class) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface.
type Diff ¶
type Diff struct {
Prev, Next *Root
}
Diff is a patch.Differ that finds differences between two Root values.
type DiffCallback ¶
Diff is a patch.Differ that finds differences between two Callback values.
func (*DiffCallback) Diff ¶
func (d *DiffCallback) Diff() (actions []patch.Action)
type DiffClass ¶
type DiffClass struct {
Prev, Next *Class
// ExcludeMembers indicates whether members should be diffed.
ExcludeMembers bool
}
Diff is a patch.Differ that finds differences between two Class values.
type DiffEnum ¶
type DiffEnum struct {
Prev, Next *Enum
// ExcludeEnumItems indicates whether enum items should be diffed.
ExcludeEnumItems bool
}
Diff is a patch.Differ that finds differences between two Enum values.
type DiffEnumItem ¶
Diff is a patch.Differ that finds differences between two EnumItem values.
func (*DiffEnumItem) Diff ¶
func (d *DiffEnumItem) Diff() (actions []patch.Action)
type DiffFunction ¶
Diff is a patch.Differ that finds differences between two Function values.
func (*DiffFunction) Diff ¶
func (d *DiffFunction) Diff() (actions []patch.Action)
type DiffProperty ¶
Diff is a patch.Differ that finds differences between two Property values.
func (*DiffProperty) Diff ¶
func (d *DiffProperty) Diff() (actions []patch.Action)
type Enum ¶
Enum represents an enum descriptor.
func (*Enum) Copy ¶
Copy returns a deep copy of the enum descriptor.
Copy implements the rbxapi.Enum interface.
func (*Enum) GetEnumItem ¶
GetEnumItem returns the first item of the given name, or nil if no item of the given name is present.
GetEnumItem implements the rbxapi.Enum interface.
func (*Enum) GetEnumItems ¶
GetEnumItems returns a list of items of the enum.
GetEnumItems implements the rbxapi.Enum interface.
type EnumItem ¶
EnumItem represents an enum item descriptor.
func (*EnumItem) Copy ¶
Copy returns a deep copy of the enum item descriptor.
Copy implements the rbxapi.EnumItem interface.
func (*EnumItem) GetName ¶
GetName returns the name of the enum item.
GetName implements the rbxapi.EnumItem interface.
type Event ¶
Event represents a class member of the Event member type.
func (*Event) Copy ¶
Copy returns a deep copy of the member descriptor.
Copy implements the rbxapi.Member interface.
func (*Event) GetMemberType ¶
GetMemberType returns a string indicating the the type of member.
GetMemberType implements the rbxapi.Member interface.
func (*Event) GetName ¶
GetName returns the name of the member.
GetName implements the rbxapi.Member interface.
func (*Event) GetParameters ¶
func (member *Event) GetParameters() rbxapi.Parameters
GetParameters returns the list of parameters describing the arguments received from the event. These parameters cannot have default values.
GetParameters implements the rbxapi.Event interface.
func (*Event) GetSecurity ¶
GetSecurity returns the security context of the member's access.
GetSecurity implements the rbxapi.Event interface.
type Function ¶
type Function struct { Name string Parameters []Parameter ReturnType Type Security string Tags `json:",omitempty"` }
Function represents a class member of the Function member type.
func (*Function) Copy ¶
Copy returns a deep copy of the member descriptor.
Copy implements the rbxapi.Member interface.
func (*Function) GetMemberType ¶
GetMemberType returns a string indicating the the type of member.
GetMemberType implements the rbxapi.Member interface.
func (*Function) GetName ¶
GetName returns the name of the member.
GetName implements the rbxapi.Member interface.
func (*Function) GetParameters ¶
func (member *Function) GetParameters() rbxapi.Parameters
GetParameters returns the list of parameters describing the arguments passed to the function. These parameters may have default values.
GetParameters implements the rbxapi.Function interface.
func (*Function) GetReturnType ¶
GetReturnType returns the type of value returned by the function.
GetReturnType implements the rbxapi.Function interface.
func (*Function) GetSecurity ¶
GetSecurity returns the security context of the member's access.
GetSecurity implements the rbxapi.Function interface.
type Parameter ¶
Parameter represents a parameter of a function, event, or callback member.
func (Parameter) Copy ¶
Copy returns a deep copy of the parameter.
Copy implements the rbxapi.Parameter interface.
func (Parameter) GetDefault ¶
GetDefault returns a string representing the default value of the parameter, and whether a default value is present.
GetDefault implements the rbxapi.Parameter interface.
func (Parameter) GetName ¶
GetName returns the name describing the parameter.
GetName implements the rbxapi.Parameter interface.
func (Parameter) GetType ¶
GetType returns the type of the parameter value.
GetType implements the rbxapi.Parameter interface.
func (*Parameter) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface.
func (*Parameter) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface.
type Parameters ¶
type Parameters struct {
List *[]Parameter
}
func (Parameters) Copy ¶
func (params Parameters) Copy() rbxapi.Parameters
func (Parameters) GetLength ¶
func (params Parameters) GetLength() int
func (Parameters) GetParameter ¶
func (params Parameters) GetParameter(index int) rbxapi.Parameter
func (Parameters) GetParameters ¶
func (params Parameters) GetParameters() []rbxapi.Parameter
type Property ¶
type Property struct { Name string ValueType Type Category string ReadSecurity string WriteSecurity string CanLoad bool CanSave bool Tags `json:",omitempty"` }
Property represents a class member of the Property member type.
func (*Property) Copy ¶
Copy returns a deep copy of the member descriptor.
Copy implements the rbxapi.Member interface.
func (*Property) GetMemberType ¶
GetMemberType returns a string indicating the the type of member.
GetMemberType implements the rbxapi.Member interface.
func (*Property) GetName ¶
GetName returns the name of the member.
GetName implements the rbxapi.Member interface.
func (*Property) GetSecurity ¶
GetSecurity returns the security context associated with the property's read and write access.
GetSecurity implements the rbxapi.Property interface.
func (*Property) GetValueType ¶
GetValueType returns the type of value stored in the property.
GetValueType implements the rbxapi.Property interface.
type Root ¶
Root represents the top-level structure of an API.
func (*Root) Copy ¶
Copy returns a deep copy of the API structure.
Copy implements the rbxapi.Root interface.
func (*Root) GetClass ¶
GetClass returns the first class descriptor of the given name, or nil if no class of the given name is present.
GetClass implements the rbxapi.Root interface.
func (*Root) GetClasses ¶
GetClasses returns a list of class descriptors present in the API.
GetClasses implements the rbxapi.Root interface.
func (*Root) GetEnum ¶
GetEnum returns the first enum descriptor of the given name, or nil if no enum of the given name is present.
GetEnum implements the rbxapi.Root interface.
func (*Root) GetEnums ¶
GetEnums returns a list of enum descriptors present in the API.
GetEnums implements the rbxapi.Root interface.
func (*Root) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface.
func (*Root) Patch ¶
Patch transforms the API structure by applying a list of patch actions.
Patch implements the patch.Patcher interface.
func (*Root) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface.
type Tags ¶
type Tags []string
Tags contains the list of tags of a descriptor.
func (Tags) GetTag ¶
GetTag returns whether the given tag is present in the descriptor.
GetTag implements the rbxapi.Taggable interface.
func (Tags) GetTags ¶
GetTags returns a list of all tags present in the descriptor.
GetTags implements the rbxapi.Taggable interface.
type Type ¶
Type represents a value type.
func (Type) GetCategory ¶
GetCategory returns the category of the type.
GetCategory implements the rbxapi.Type interface.
type VersionError ¶
type VersionError interface { error // VersionError returns the unsupported version. VersionError() int }
VersionError is an error indicating that the version of the JSON format is unsupported.