apiprogram

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GOErrorFromProto

func GOErrorFromProto(pb *pbprogram.Error) (error, error)

func SprintCallStack

func SprintCallStack(cs []*CallFrame) string

Types

type CallFrame

type CallFrame struct {
	// contains filtered or unexported fields
}

func CallFrameFromProto

func CallFrameFromProto(pb *pbprogram.CallFrame) (*CallFrame, error)

func MustCallFrameFromProto

func MustCallFrameFromProto(pb *pbprogram.CallFrame) *CallFrame

func MustNewCallFrame

func MustNewCallFrame(name string, loc *Location) *CallFrame

func NewCallFrame

func NewCallFrame(name string, loc *Location) (*CallFrame, error)

func (*CallFrame) Clone

func (f *CallFrame) Clone() *CallFrame

func (*CallFrame) Location

func (f *CallFrame) Location() *Location

func (*CallFrame) Name

func (f *CallFrame) Name() string

func (*CallFrame) PB

func (f *CallFrame) PB() *pbprogram.CallFrame

func (*CallFrame) String

func (f *CallFrame) String() string

type Error

type Error struct {
	// contains filtered or unexported fields
}

func ErrorFromGRPCError

func ErrorFromGRPCError(err error) *Error

func ErrorFromProto

func ErrorFromProto(pb *pbprogram.Error) (*Error, error)

func ImportError

func ImportError(err error) *Error

func MustErrorFromProto

func MustErrorFromProto(pb *pbprogram.Error) *Error

func MustNewError

func MustNewError(msg, typ string, callstack []*CallFrame, next *Error) *Error

func NewError

func NewError(msg, typ string, callstack []*CallFrame, next *Error) (*Error, error)

func NewErrors

func NewErrors(errs []*Error) *Error

func (*Error) CallStack

func (e *Error) CallStack() []*CallFrame

func (*Error) Clone

func (e *Error) Clone() *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) MarshalJSON

func (e *Error) MarshalJSON() ([]byte, error)

func (*Error) Msg

func (e *Error) Msg() string

func (*Error) Next

func (e *Error) Next() *Error

func (*Error) PB

func (e *Error) PB() *pbprogram.Error

func (*Error) ToError

func (e *Error) ToError() (err error)

this will make the return value a real "nil" error if needed.

func (*Error) Type

func (e *Error) Type() string

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(bs []byte) error

type Location

type Location struct {
	// contains filtered or unexported fields
}

func LocationFromProto

func LocationFromProto(pb *pbprogram.Location) (*Location, error)

func MustLocationFromProto

func MustLocationFromProto(pb *pbprogram.Location) *Location

func MustNewLocation

func MustNewLocation(path *Path, line, col int32) *Location

func NewLocation

func NewLocation(path *Path, line, col int32) (*Location, error)

func (*Location) Clone

func (l *Location) Clone() *Location

func (*Location) MarshalJSON

func (l *Location) MarshalJSON() ([]byte, error)

func (*Location) PB

func (l *Location) PB() *pbprogram.Location

func (*Location) Path

func (l *Location) Path() *Path

func (*Location) String

func (l *Location) String() (s string)

func (*Location) UnmarshalJSON

func (l *Location) UnmarshalJSON(bs []byte) error

type Module

type Module struct {
	// contains filtered or unexported fields
}

func ModuleFromProto

func ModuleFromProto(pb *pbprogram.Module) (*Module, error)

func MustModuleFromProto

func MustModuleFromProto(pb *pbprogram.Module) *Module

func NewModule

func NewModule(lang string, predecls []string, compilerVersion string, path *Path, compiled []byte) (*Module, error)

func (*Module) Clone

func (m *Module) Clone() *Module

func (*Module) CompiledCode

func (m *Module) CompiledCode() []byte

func (*Module) CompilerVersion

func (m *Module) CompilerVersion() string

func (*Module) Lang

func (m *Module) Lang() string

func (*Module) MarshalJSON

func (m *Module) MarshalJSON() ([]byte, error)

func (*Module) PB

func (m *Module) PB() *pbprogram.Module

func (*Module) SetSourcePath

func (m *Module) SetSourcePath(p *Path) *Module

func (*Module) SourcePath

func (m *Module) SourcePath() *Path

func (*Module) UnmarshalJSON

func (m *Module) UnmarshalJSON(bs []byte) error

func (*Module) Validate

func (m *Module) Validate() error

type Path

type Path struct {
	// contains filtered or unexported fields
}

func JoinPaths

func JoinPaths(root, path *Path) (*Path, error)

func JoinWithParent added in v0.6.6

func JoinWithParent(parent, child *Path) (*Path, error)

func MustNewPath added in v0.6.0

func MustNewPath(scheme, path, version string) *Path

func MustParsePathString

func MustParsePathString(s string) *Path

func MustPathFromProto

func MustPathFromProto(pb *pbprogram.Path) *Path

func NewPath

func NewPath(scheme, path, version string) (*Path, error)

func ParsePathString

func ParsePathString(s string) (*Path, error)

func ParsePathStringOr

func ParsePathStringOr(s string, or *Path) *Path

func PathFromProto

func PathFromProto(pb *pbprogram.Path) (*Path, error)

func (*Path) Clone

func (p *Path) Clone() *Path

func (*Path) Equal

func (p *Path) Equal(o *Path) bool

func (*Path) Ext

func (p *Path) Ext() string

func (*Path) IsInternal

func (p *Path) IsInternal() bool

func (*Path) IsRelative added in v0.6.6

func (p *Path) IsRelative() bool

func (*Path) MarshalJSON

func (p *Path) MarshalJSON() ([]byte, error)

func (*Path) PB

func (p *Path) PB() *pbprogram.Path

func (*Path) Path

func (p *Path) Path() string

func (*Path) PathAndVersion

func (p *Path) PathAndVersion() string

func (*Path) PluginID

func (p *Path) PluginID() (apiplugin.PluginID, bool)

func (*Path) Scheme

func (p *Path) Scheme() string

func (*Path) String

func (p *Path) String() string

func (*Path) UnmarshalJSON

func (p *Path) UnmarshalJSON(bs []byte) error

func (*Path) Version

func (p *Path) Version() string

func (*Path) WithVersion

func (p *Path) WithVersion(v string) *Path

type PathPB

type PathPB = pbprogram.Path

Jump to

Keyboard shortcuts

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