model

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppTypeHTTP indicates HTTP Dapr protocol
	AppTypeHTTP = "HTTP"
	// AppTypeGRPC indicates gRPC Dapr protocol
	AppTypeGRPC = "gRPC"
	// AppTypeCLI indicates commandline app
	AppTypeCLI = "CLI"
)

Variables

This section is empty.

Functions

func GetAppTypes added in v0.4.2

func GetAppTypes() []string

GetAppTypes returns supported app types

func InputBindingComponentTypes

func InputBindingComponentTypes() []string

InputBindingComponentTypes lists all supported components

func OutputBindingComponentTypes

func OutputBindingComponentTypes() []string

OutputBindingComponentTypes lists all supported components

func PubsubComponentTypes

func PubsubComponentTypes() []string

PubsubComponentTypes lists all supported components

func SecretComponentTypes

func SecretComponentTypes() []string

SecretComponentTypes lists all supported components

func StateComponentTypes

func StateComponentTypes() []string

StateComponentTypes lists all supported components

Types

type App

type App struct {
	Meta       Meta         `yaml:"Meta"`
	PubSubs    []*PubSub    `yaml:"PubSubs"`
	Bindings   []*Component `yaml:"Bindings"`
	Services   []*Service   `yaml:"Services"`
	Components []*Component `yaml:"Components"`
}

App represents app state

func Unmarshal

func Unmarshal(in []byte) (*App, error)

Unmarshal deserializes bytes into an App

func (*App) Marshal

func (a *App) Marshal() ([]byte, error)

Marshal serializes App to YAML

func (*App) String

func (a *App) String() string

String serializes App to YAML string

type Component

type Component struct {
	Name string `yaml:"Name"`
	Type string `yaml:"Type"`
}

Component represents a Dapr component

func (*Component) GetName

func (c *Component) GetName() string

GetName returns the name of the component

func (*Component) GetType

func (c *Component) GetType() string

GetType returns the name of the component type

type Componentable

type Componentable interface {
	GetType() string
	GetName() string
}

Componentable defines the component interface

type Meta

type Meta struct {
	Name       string `yaml:"Name"`
	Type       string `yaml:"Type"`
	Lang       string `yaml:"Lang"`
	Main       string `yaml:"Main"`
	Port       int    `yaml:"Port"`
	UsesClient bool   `yaml:"UsesClient"`
	Owner      string `yaml:"Owner"`
}

Meta represents app metadata

type Project added in v0.4.2

type Project struct {
	Main      string
	PortHTTP  int
	PortGRPC  int
	Templates map[string]string
}

Project represents app project

type PubSub

type PubSub struct {
	Name  string `yaml:"Name"`
	Type  string `yaml:"Type"`
	Topic string `yaml:"Topic"`
}

PubSub represents PubSub component

func (*PubSub) GetName

func (c *PubSub) GetName() string

GetName returns the name of the component

func (*PubSub) GetType

func (c *PubSub) GetType() string

GetType returns the name of the component type

type Service

type Service struct {
	Name string `yaml:"Name"`
}

Service represents Service invocations

Jump to

Keyboard shortcuts

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