schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 14 Imported by: 4

Documentation

Index

Constants

View Source
const (
	BaseURL = "https://developer.apple.com/documentation/"
	Version = 2
)

Variables

This section is empty.

Functions

func Stats

func Stats()

func Types

func Types(path string)

Types

type Arg

type Arg struct {
	Name string `json:",omitempty"`
	Type DataType
}

func ArgFromAst

func ArgFromAst(ai declparse.ArgInfo) Arg

type Class

type Class struct {
	Name        string
	Description string
	Declaration string

	InstanceMethods    []Method   `json:",omitempty"`
	InstanceProperties []Property `json:",omitempty"`

	TypeMethods    []Method   `json:",omitempty"`
	TypeProperties []Property `json:",omitempty"`

	Frameworks []string
	Platforms  []string

	Deprecated bool   `json:",omitempty"`
	TopicURL   string `json:",omitempty"`
}

type DataType

type DataType struct {
	Name        string     `json:",omitempty"`
	IsPtr       bool       `json:",omitempty"`
	IsPtrPtr    bool       `json:",omitempty"`
	Annotations []string   `json:",omitempty"`
	FuncPtr     *Func      `json:",omitempty"`
	Block       *Func      `json:",omitempty"`
	Params      []DataType `json:",omitempty"`
}

func DataTypeFromAst

func DataTypeFromAst(ti declparse.TypeInfo) (dt DataType)

type Func

type Func struct {
	Name     string `json:",omitempty"`
	Return   DataType
	Args     []Arg
	TopicURL string `json:",omitempty"`
}

func FuncFromAst

func FuncFromAst(fn *declparse.FunctionDecl) *Func
type Link struct {
	Section string
	Name    string
	Path    string
}

type Lookup

type Lookup struct {
	Query   string
	Lang    string
	Name    string
	Prefix  string
	DocPath string
	APIPath string
	URL     string
}

func LookupFromPath

func LookupFromPath(path string) Lookup

func NewLookup

func NewLookup(query, lang string) Lookup

func (Lookup) APIExists

func (l Lookup) APIExists() bool

func (Lookup) DocExists

func (l Lookup) DocExists() bool

type Method

type Method struct {
	Name        string
	Description string
	Declaration string
	Return      DataType
	Args        []Arg
	Deprecated  bool   `json:",omitempty"`
	TopicURL    string `json:",omitempty"`
}

func MethodFromAst

func MethodFromAst(m declparse.MethodDecl) Method

type Property

type Property struct {
	Name        string
	Description string
	Declaration string
	Type        DataType
	Attrs       map[string]interface{}
	Deprecated  bool   `json:",omitempty"`
	TopicURL    string `json:",omitempty"`
}

func PropertyFromAst

func PropertyFromAst(p declparse.PropertyDecl) Property

type Schema

type Schema struct {
	Class *Class `json:",omitempty"`

	Kind     string
	PullDate time.Time
	Version  int
}

func PullSchema

func PullSchema(l Lookup) Schema

type Topic

type Topic struct {
	Path        string
	Title       string
	Type        string
	Description string
	Declaration string
	Frameworks  []string
	Platforms   []string
	Topics      []Link
	LastFetch   time.Time
	LastVersion int
}

func FetchTopic

func FetchTopic(l Lookup) Topic

func ReadTopic

func ReadTopic(l Lookup) (t Topic, err error)

Jump to

Keyboard shortcuts

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