functionref

package
v0.0.0-...-98ba599 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidType  = errors.New("invalid type")
	ErrParseFailed  = errors.New("failed to parse")
	ErrFormatFailed = errors.New("failed to format")
)

Functions

func Format

func Format(ref fission.FunctionReference) (string, error)

func Parse

func Parse(ref interface{}) (fission.FunctionReference, error)

Types

type ComposedFormatter

type ComposedFormatter struct {
	Formatters []Formatter
}

func (*ComposedFormatter) Format

type ComposedParser

type ComposedParser struct {
	Parsers []Parser
}

func (*ComposedParser) Parse

func (cp *ComposedParser) Parse(ref interface{}) (fission.FunctionReference, error)

type Formatter

type Formatter interface {
	Format(ref fission.FunctionReference) (string, error)
}
var DefaultFormatter Formatter = &ComposedFormatter{[]Formatter{
	&NameParserFormatter{},
}}

type NameParserFormatter

type NameParserFormatter struct{}

func (*NameParserFormatter) Format

func (*NameParserFormatter) Parse

func (np *NameParserFormatter) Parse(ref interface{}) (fission.FunctionReference, error)

type Parser

type Parser interface {
	Parse(ref interface{}) (fission.FunctionReference, error)
}
var DefaultParser Parser = &ComposedParser{[]Parser{
	&SelfParser{},
	&NameParserFormatter{},
}}

type SelfParser

type SelfParser struct{}

func (*SelfParser) Parse

func (sp *SelfParser) Parse(ref interface{}) (fission.FunctionReference, error)

Jump to

Keyboard shortcuts

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