codeconfig

package
v1.0.0-develop.9 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Populate

func Populate(initial *stack.Stack) (*stack.Stack, error)

Types

type Api

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

func (*Api) AddWorker

func (a *Api) AddWorker(worker *pb.ApiWorker) error

func (*Api) String

func (a *Api) String() string

type CodeConfig

type CodeConfig interface {
	Collect() error
	ToStack() (*stack.Stack, error)
}

CodeConfig - represents a collection of related functions and their shared dependencies.

func New

func New(s *stack.Stack) (CodeConfig, error)

type FunctionDependencies

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

FunctionDependencies - Stores information about a Nitric Function, and it's dependencies

func NewFunction

func NewFunction(name string) *FunctionDependencies

NewFunction - creates a new Nitric Function, ready to register handlers and dependencies.

func (*FunctionDependencies) AddApiHandler

func (a *FunctionDependencies) AddApiHandler(aw *pb.ApiWorker) error

func (*FunctionDependencies) AddBucket

func (a *FunctionDependencies) AddBucket(name string, b *pb.BucketResource)

AddBucket - adds a storage bucket dependency to the function

func (*FunctionDependencies) AddCollection

func (a *FunctionDependencies) AddCollection(name string, c *pb.CollectionResource)

AddCollection - adds a document database collection dependency to the function

func (*FunctionDependencies) AddPolicy

func (a *FunctionDependencies) AddPolicy(p *pb.PolicyResource)

AddPolicy - Adds an access policy dependency to the function

func (*FunctionDependencies) AddQueue

func (a *FunctionDependencies) AddQueue(name string, q *pb.QueueResource)

AddQueue - adds a queue dependency to the function

func (*FunctionDependencies) AddScheduleHandler

func (a *FunctionDependencies) AddScheduleHandler(sw *pb.ScheduleWorker) error

AddScheduleHandler - registers a handler in the function that runs on a schedule

func (*FunctionDependencies) AddSubscriptionHandler

func (a *FunctionDependencies) AddSubscriptionHandler(sw *pb.SubscriptionWorker) error

AddSubscriptionHandler - registers a handler in the function that subscribes to a topic of events

func (*FunctionDependencies) AddTopic

func (a *FunctionDependencies) AddTopic(name string, t *pb.TopicResource)

AddTopic - adds a pub/sub topic dependency to the function

type Server

type Server struct {
	pb.UnimplementedFaasServiceServer
	pb.UnimplementedResourceServiceServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(name string, function *FunctionDependencies) *Server

NewServer - Creates a new deployment server

func (*Server) Declare

Declare - Accepts resource declarations, adding them as dependencies to the Function

func (*Server) TriggerStream

func (s *Server) TriggerStream(stream pb.FaasService_TriggerStreamServer) error

TriggerStream - Starts a new FaaS server stream

The deployment server collects information from stream InitRequests, then immediately terminates the stream This behavior captures enough information to identify function handlers, without executing the handler code during the build process.

Jump to

Keyboard shortcuts

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