gen

package
v0.0.0-...-b8125bf Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandType  = AssetType("Command")
	QueryType    = AssetType("Query")
	MutationType = AssetType("Mutation")
	FunctionType = AssetType("Function")
)

Variables

This section is empty.

Functions

func CmdRan

func CmdRan(err error) bool

func Exec

func Exec(dir string, cmd string, args ...string) (ran bool, err error)

func ExitStatus

func ExitStatus(err error) int

ExitStatus returns the exit status of the error if it is an exec.ExitError or if it implements ExitStatus() int. 0 if it is nil or 1 if it is a different error.

Types

type Asset

type Asset interface {
	Type() AssetType
	Name() string
	Key() string
	PackageName() string

	SetBuildPath(path string)
	BuildPath() string
	SetS3Key(key string)
	S3Key() string
}

type AssetType

type AssetType string

type CDKConfig

type CDKConfig struct {
	App     string     `json:"app"`
	Context CDKContext `json:"context"`
}

type CDKContext

type CDKContext struct {
	Name   string `json:"name"`
	Bucket string `json:"bucket"`
}

type Command

type Command struct {
	*Method
}

func (*Command) Type

func (c *Command) Type() AssetType

type Config

type Config struct {
	ServiceName string         `json:"service"`
	Bucket      string         `json:"bucket"`
	Events      []string       `json:"events,omitempty"`
	Commands    []ConfigMethod `json:"commands,omitempty"`
	Queries     []ConfigMethod `json:"queries,omitempty"`
	Mutation    *ConfigMethod  `json:"mutations,omitempty"`
	Functions   []ConfigMethod `json:"functions,omitempty"`
}

Config - TODO: some meta about commit version

type ConfigMethod

type ConfigMethod struct {
	Name    string `json:"name"`
	S3Key   string `json:"s3Key"`
	Handler string `json:"handler"`
	Runtime string `json:"runtime"`
}

type Handler

type Handler func()

type Method

type Method struct {
	ServiceType reflect.Type
	Method      reflect.Method
	Event       reflect.Type
	// contains filtered or unexported fields
}

func (*Method) BuildPath

func (m *Method) BuildPath() string

func (*Method) Imports

func (m *Method) Imports() []string

func (*Method) Inputs

func (m *Method) Inputs() []reflect.Type

func (*Method) Key

func (m *Method) Key() string

func (*Method) Name

func (m *Method) Name() string

func (*Method) Outputs

func (m *Method) Outputs() []reflect.Type

func (*Method) Package

func (m *Method) Package() string

func (*Method) PackageName

func (m *Method) PackageName() string

func (*Method) S3Key

func (m *Method) S3Key() string

func (*Method) SetBuildPath

func (m *Method) SetBuildPath(path string)

func (*Method) SetS3Key

func (m *Method) SetS3Key(key string)

func (*Method) String

func (m *Method) String() string

type Mutation

type Mutation struct {
	ServiceType reflect.Type
	Methods     []*Method
	// contains filtered or unexported fields
}

func (*Mutation) Add

func (m *Mutation) Add(method reflect.Method) error

func (*Mutation) BuildPath

func (m *Mutation) BuildPath() string

func (Mutation) EventNames

func (m Mutation) EventNames() []string

func (Mutation) EventTypes

func (m Mutation) EventTypes() []reflect.Type

func (Mutation) Events

func (m Mutation) Events() []string

func (Mutation) Imports

func (m Mutation) Imports() []string

TODO: sort imports

func (Mutation) Key

func (m Mutation) Key() string

func (Mutation) Name

func (m Mutation) Name() string

func (Mutation) Package

func (m Mutation) Package() string

func (Mutation) PackageName

func (m Mutation) PackageName() string

func (*Mutation) S3Key

func (m *Mutation) S3Key() string

func (*Mutation) SetBuildPath

func (m *Mutation) SetBuildPath(path string)

func (*Mutation) SetS3Key

func (m *Mutation) SetS3Key(key string)

func (*Mutation) Type

func (m *Mutation) Type() AssetType

type Query

type Query struct {
	*Method
}

func (*Query) Type

func (c *Query) Type() AssetType

type Service

type Service struct {
	Commands []*Command
	Mutation *Mutation
	Queries  []*Query
	// contains filtered or unexported fields
}

func New

func New() (*Service, error)

New Service

func (*Service) AddCommands

func (svc *Service) AddCommands(input interface{})

AddCommands -

func (*Service) AddFunction

func (svc *Service) AddFunction(handler Handler) error

AddFunction - trigger should be plain method which is called in lambda.Start()

func (*Service) AddMutation

func (svc *Service) AddMutation(input interface{}) error

AddMutation - TODO: mutation has following structure: OnEvent(context, Event) error

func (*Service) AddQueries

func (svc *Service) AddQueries(input interface{})

AddQueries -

func (*Service) Build

func (svc *Service) Build() error

func (*Service) Clean

func (svc *Service) Clean() error

func (*Service) Config

func (svc *Service) Config() *Config

func (*Service) Deploy

func (svc *Service) Deploy() error

func (*Service) Initialize

func (svc *Service) Initialize() error

func (*Service) Publish

func (svc *Service) Publish() error

func (*Service) String

func (svc *Service) String() string

func (*Service) Write

func (svc *Service) Write(name string) error

TODO: check existance

type Uploader

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

func NewUploader

func NewUploader(bucket string, prefix string) (*Uploader, error)

func (Uploader) Upload

func (u Uploader) Upload(assets []Asset) error

Jump to

Keyboard shortcuts

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