rbxapidump

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

The rbxapidump package implements the rbxapi interface as a codec for the Roblox API dump 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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(w io.Writer, root *Root) (err error)

Encode encodes root, writing the results to w in the API dump format.

Types

type Callback

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

Callback represents an event member descriptor.

func (*Callback) Copy

func (member *Callback) Copy() rbxapi.Member

Copy returns a deep copy of the member descriptor.

Copy implements the rbxapi.Member interface.

func (*Callback) GetMemberType

func (member *Callback) GetMemberType() string

GetMemberType returns a string indicating the the type of member.

GetMemberType implements the rbxapi.Member interface.

func (*Callback) GetName

func (member *Callback) GetName() string

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

func (member *Callback) GetReturnType() rbxapi.Type

GetReturnType returns the type of value that is returned by the callback.

GetReturnType implements the rbxapi.Callback interface.

func (*Callback) GetSecurity

func (member *Callback) GetSecurity() string

GetSecurity returns the security context of the member's access.

GetSecurity implements the rbxapi.Callback interface.

func (*Callback) Patch

func (member *Callback) Patch(actions []patch.Action)

type Class

type Class struct {
	Name       string
	Superclass string
	Members    []rbxapi.Member
	Tags
}

Class represents a class descriptor.

func (*Class) Copy

func (class *Class) Copy() rbxapi.Class

Copy returns a deep copy of the class descriptor.

Copy implements the rbxapi.Class interface.

func (*Class) GetMember

func (class *Class) GetMember(name string) rbxapi.Member

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

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

GetMembers returns a list of member descriptors belonging to the class.

GetMembers implements the rbxapi.Class interface.

func (*Class) GetName

func (class *Class) GetName() string

GetName returns the class name.

GetName implements the rbxapi.Class interface.

func (*Class) GetSuperclass

func (class *Class) GetSuperclass() string

GetSuperclass returns the name of the class that this class inherits from.

GetSuperclass implements the rbxapi.Class interface.

func (*Class) Patch

func (class *Class) Patch(actions []patch.Action)

type Enum

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

Enum represents an enum descriptor.

func (*Enum) Copy

func (enum *Enum) Copy() rbxapi.Enum

Copy returns a deep copy of the enum descriptor.

Copy implements the rbxapi.Enum interface.

func (*Enum) GetEnumItem

func (enum *Enum) GetEnumItem(name string) rbxapi.EnumItem

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

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

GetEnumItems returns a list of items of the enum.

GetEnumItems implements the rbxapi.Enum interface.

func (*Enum) GetName

func (enum *Enum) GetName() string

GetName returns the name of the enum.

GetName implements the rbxapi.Enum interface.

func (*Enum) Patch

func (enum *Enum) Patch(actions []patch.Action)

type EnumItem

type EnumItem struct {
	Enum  string
	Name  string
	Value int
	Tags
}

EnumItem represents an enum item descriptor.

func (*EnumItem) Copy

func (item *EnumItem) Copy() rbxapi.EnumItem

Copy returns a deep copy of the enum item descriptor.

Copy implements the rbxapi.EnumItem interface.

func (*EnumItem) GetName

func (item *EnumItem) GetName() string

GetName returns the name of the enum item.

GetName implements the rbxapi.EnumItem interface.

func (*EnumItem) GetValue

func (item *EnumItem) GetValue() int

GetValue returns the value of the enum item.

GetValue implements the rbxapi.EnumItem interface.

func (*EnumItem) Patch

func (item *EnumItem) Patch(actions []patch.Action)

type Event

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

Event represents an event member descriptor.

func (*Event) Copy

func (member *Event) Copy() rbxapi.Member

Copy returns a deep copy of the member descriptor.

Copy implements the rbxapi.Member interface.

func (*Event) GetMemberType

func (member *Event) GetMemberType() string

GetMemberType returns a string indicating the the type of member.

GetMemberType implements the rbxapi.Member interface.

func (*Event) GetName

func (member *Event) GetName() string

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

func (member *Event) GetSecurity() string

GetSecurity returns the security context of the member's access.

GetSecurity implements the rbxapi.Event interface.

func (*Event) Patch

func (member *Event) Patch(actions []patch.Action)

type Function

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

Function represents a function member descriptor.

func (*Function) Copy

func (member *Function) Copy() rbxapi.Member

Copy returns a deep copy of the member descriptor.

Copy implements the rbxapi.Member interface.

func (*Function) GetMemberType

func (member *Function) GetMemberType() string

GetMemberType returns a string indicating the the type of member.

GetMemberType implements the rbxapi.Member interface.

func (*Function) GetName

func (member *Function) GetName() string

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

func (member *Function) GetReturnType() rbxapi.Type

GetReturnType returns the type of value returned by the function.

GetReturnType implements the rbxapi.Function interface.

func (*Function) GetSecurity

func (member *Function) GetSecurity() string

GetSecurity returns the security context of the member's access.

GetSecurity implements the rbxapi.Function interface.

func (*Function) Patch

func (member *Function) Patch(actions []patch.Action)

type Parameter

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

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

func (Parameter) Copy

func (param Parameter) Copy() rbxapi.Parameter

Copy returns a deep copy of the parameter.

Copy implements the rbxapi.Parameter interface.

func (Parameter) GetDefault

func (param Parameter) GetDefault() (value string, ok bool)

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

func (param Parameter) GetName() string

GetName returns the name describing the parameter.

GetName implements the rbxapi.Parameter interface.

func (Parameter) GetType

func (param Parameter) GetType() rbxapi.Type

GetType returns the type of the parameter value.

GetType implements the rbxapi.Parameter 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
	Class     string
	ValueType Type
	Tags
}

Property represents a property member descriptor.

func (*Property) Copy

func (member *Property) Copy() rbxapi.Member

Copy returns a deep copy of the member descriptor.

Copy implements the rbxapi.Member interface.

func (*Property) GetMemberType

func (member *Property) GetMemberType() string

GetMemberType returns a string indicating the the type of member.

GetMemberType implements the rbxapi.Member interface.

func (*Property) GetName

func (member *Property) GetName() string

GetName returns the name of the member.

GetName implements the rbxapi.Member interface.

func (*Property) GetSecurity

func (member *Property) GetSecurity() (read, write string)

GetSecurity returns the security context associated with the property's read and write access.

GetSecurity implements the rbxapi.Property interface.

func (*Property) GetValueType

func (member *Property) GetValueType() rbxapi.Type

GetValueType returns the type of value stored in the property.

GetValueType implements the rbxapi.Property interface.

func (*Property) Patch

func (member *Property) Patch(actions []patch.Action)

type Root

type Root struct {
	// Classes is the list of class descriptors present in the API.
	Classes []*Class
	// Enums is the list of enum descriptors present in the API.
	Enums []*Enum
}

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

func Decode

func Decode(r io.Reader) (root *Root, err error)

Decode parses an API dump from r.

func (*Root) Copy

func (root *Root) Copy() rbxapi.Root

Copy returns a deep copy of the API structure.

Copy implements the rbxapi.Root interface.

func (*Root) GetClass

func (root *Root) GetClass(name string) rbxapi.Class

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

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

GetClasses returns a list of class descriptors present in the API.

GetClasses implements the rbxapi.Root interface.

func (*Root) GetEnum

func (root *Root) GetEnum(name string) rbxapi.Enum

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

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

GetEnums returns a list of enum descriptors present in the API.

GetEnums implements the rbxapi.Root interface.

func (*Root) Patch

func (root *Root) Patch(actions []patch.Action)

Patch transforms the API structure by applying a list of patch actions.

Patch implements the patch.Patcher interface.

type SyntaxError

type SyntaxError interface {
	error
	// SyntaxError returns an error message and the line on which the error
	// occurred.
	SyntaxError() (msg string, line int)
}

SyntaxError indicates that a syntax error occurred while decoding.

type Tags

type Tags []string

Tags contains the list of tags of a descriptor.

func (Tags) GetTag

func (tags Tags) GetTag(tag string) bool

GetTag returns whether the given tag is present in the descriptor.

GetTag implements the rbxapi.Taggable interface.

func (Tags) GetTags

func (tags Tags) GetTags() []string

GetTags returns a copy of the tags as a slice of strings.

GetTags implements the rbxapi.Taggable interface.

func (*Tags) SetTag

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

SetTag adds one or more tags to the list. Duplicate tags are removed.

func (*Tags) UnsetTag

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

UnsetTag removes one or more tags from the list. Duplicate tags are removed.

type Type

type Type string

Type represents a value type.

func (Type) Copy

func (typ Type) Copy() rbxapi.Type

Copy returns a deep copy of the type.

Copy implements the rbxapi.Type interface.

func (Type) GetCategory

func (typ Type) GetCategory() string

GetCategory returns the category of the type. This will be empty when the type has no category.

GetCategory implements the rbxapi.Type interface.

func (Type) GetName

func (typ Type) GetName() string

GetName returns the name of the type.

GetName implements the rbxapi.Type interface.

func (*Type) SetFromType

func (typ *Type) SetFromType(t rbxapi.Type)

SetFromType sets the name of the type from a generic rbxapi.Type.

func (Type) String

func (typ Type) String() string

String returns a string representation of the type.

String implements the rbxapi.Type interface.

Jump to

Keyboard shortcuts

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