 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- type Argument
- type General
- type Handler
- func (h *Handler) In() string
- func (h *Handler) Incrementable() bool
- func (h *Handler) MethodWithBody() bool
- func (h *Handler) Name() string
- func (h *Handler) Observable() bool
- func (h *Handler) Out() string
- func (h *Handler) Port() (string, error)
- func (h *Handler) SourceSuffix() string
- func (h *Handler) UnmarshalYAML(unmarshal func(interface{}) error) error
 
- type Service
- type Signature
- type Type
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type General ¶
type General struct {
	Host             string `yaml:"host"`
	Description      string `yaml:"description"`
	IntegrationTests bool   `yaml:"integrationTests"`
	OpenAPI          bool   `yaml:"openApi"`
}
    General are general properties of the microservice.
func (*General) UnmarshalYAML ¶
UnmarshalYAML parses and validates the YAML.
type Handler ¶
type Handler struct {
	Type   string `yaml:"-"`
	Exists bool   `yaml:"-"`
	// Shared
	Signature   *Signature `yaml:"signature"`
	Description string     `yaml:"description"`
	Method      string     `yaml:"method"`
	Path        string     `yaml:"path"`
	Queue       string     `yaml:"queue"`
	OpenAPI     bool       `yaml:"openApi"`
	// Sink
	Event   string `yaml:"event"`
	Source  string `yaml:"source"`
	ForHost string `yaml:"forHost"`
	// Config
	Default    string `yaml:"default"`
	Validation string `yaml:"validation"`
	Callback   bool   `yaml:"callback"`
	Secret     bool   `yaml:"secret"`
	// Metrics
	Kind    string    `json:"kind" yaml:"kind"`
	Alias   string    `json:"alias" yaml:"alias"`
	Buckets []float64 `json:"buckets" yaml:"buckets"`
	// Ticker
	Interval time.Duration `yaml:"interval"`
}
    Handler is the spec of a callback handler. Web requests, lifecycle events, config changes, tickers, etc.
func (*Handler) Incrementable ¶
Incrementable indicates if the metric can be incremented.
func (*Handler) MethodWithBody ¶
MethodWithBody indicates if the HTTP method of the endpoint allows sending a body. "GET", "DELETE", "TRACE", "OPTIONS", "HEAD" do not allow a body.
func (*Handler) Observable ¶
Observable indicates if the metric can be observed.
func (*Handler) SourceSuffix ¶
SourceSuffix returns the last piece of the event source package path, which is expected to point to a microservice.
func (*Handler) UnmarshalYAML ¶
UnmarshalYAML parses the handler.
type Service ¶
type Service struct {
	Package string `yaml:"-"`
	General   General    `yaml:"general"`
	Configs   []*Handler `yaml:"configs"`
	Metrics   []*Handler `yaml:"metrics"`
	Functions []*Handler `yaml:"functions"`
	Events    []*Handler `yaml:"events"`
	Sinks     []*Handler `yaml:"sinks"`
	Webs      []*Handler `yaml:"webs"`
	Tickers   []*Handler `yaml:"tickers"`
	Types []*Type `yaml:"-"`
	// contains filtered or unexported fields
}
    Service is the spec of the microservice parsed from service.yaml.
func (*Service) AllHandlers ¶
AllHandlers returns an array holding all handlers of all types.
func (*Service) FullyQualifyTypes ¶
func (s *Service) FullyQualifyTypes()
FullyQualifyTypes prepends the API package name to complex types of function arguments.
func (*Service) PackageSuffix ¶
PackageSuffix returns only the last portion of the full package path.
func (*Service) ShorthandTypes ¶
func (s *Service) ShorthandTypes()
ShorthandTypes removed the API package name from complex types of function arguments.
func (*Service) UnmarshalYAML ¶
UnmarshalYAML parses and validates the YAML.
type Signature ¶
type Signature struct {
	OrigString string
	Name       string
	InputArgs  []*Argument
	OutputArgs []*Argument
}
    Signature is the spec of a function signature.
func (*Signature) InputArg ¶
InputArg returns the named input arg, or nil if none exist with this name.
func (*Signature) OutputArg ¶
OutputArg returns the named output arg, or nil if none exist with this name.
func (*Signature) TestingT ¶
TestingT returns "testingT" if "t" conflicts with an argument of the function. Otherwise, "t" is returned.
func (*Signature) UnmarshalYAML ¶
UnmarshalYAML parses the signature.
type Type ¶
Type is a complex type used in a function.
func (*Type) PackageSuffix ¶
PackageSuffix returns only the last portion of the full package path.