run

package
v1.33.6 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 70 Imported by: 0

Documentation

Index

Constants

View Source
const DEV_SUB_DIR_COLL = "./collections/"
View Source
const DEV_SUB_DIR_QUEUES = "./queues/"
View Source
const DEV_SUB_DIR_SECRETS = "./secrets/"

Variables

This section is empty.

Functions

func NewEvents

func NewEvents(pool pool.WorkerPool, project *project.Project) (events.EventService, error)

Create new Dev EventService

func NewQueueService added in v1.15.0

func NewQueueService() (queue.QueueService, error)

func NewResources added in v1.14.0

func NewResources(ls *localServices, isStart bool) resource.ResourceService

func NewSecretService added in v1.15.0

func NewSecretService() (secret.SecretService, error)

Create new secret store

Types

type BaseHttpGateway

type BaseHttpGateway struct {
	gateway.UnimplementedGatewayPlugin
	// contains filtered or unexported fields
}

func NewGateway

func NewGateway(wsPlugin *RunWebsocketService) (*BaseHttpGateway, error)

Create new HTTP gateway XXX: No External Args for function atm (currently the plugin loader does not pass any argument information)

func (*BaseHttpGateway) GetApiAddresses added in v1.14.1

func (s *BaseHttpGateway) GetApiAddresses() map[string]string

func (*BaseHttpGateway) GetHttpWorkerAddresses added in v1.24.0

func (s *BaseHttpGateway) GetHttpWorkerAddresses() map[int]string

func (*BaseHttpGateway) GetTriggerAddress added in v1.14.1

func (s *BaseHttpGateway) GetTriggerAddress() string

GetTriggerAddress - Returns the address built-in nitric services this can be used to publishing messages to topics or triggering schedules

func (*BaseHttpGateway) GetWebsocketAddresses added in v1.25.0

func (s *BaseHttpGateway) GetWebsocketAddresses() map[string]string

func (*BaseHttpGateway) Refresh added in v1.14.1

func (s *BaseHttpGateway) Refresh() error

Update the gateway and API based on the worker pool

func (*BaseHttpGateway) Start

func (s *BaseHttpGateway) Start(pool pool.WorkerPool) error

func (*BaseHttpGateway) Stop

func (s *BaseHttpGateway) Stop() error

type BoltDoc added in v1.15.0

type BoltDoc struct {
	Id           string `storm:"id"`
	PartitionKey string `storm:"index"`
	SortKey      string `storm:"index"`
	Value        map[string]interface{}
}

func (BoltDoc) String added in v1.15.0

func (d BoltDoc) String() string

type BoltDocService added in v1.15.0

type BoltDocService struct {
	document.UnimplementedDocumentPlugin
	// contains filtered or unexported fields
}

func NewBoltService added in v1.15.0

func NewBoltService() (*BoltDocService, error)

New - Create a new dev KV plugin

func (*BoltDocService) Delete added in v1.15.0

func (s *BoltDocService) Delete(ctx context.Context, key *document.Key) error

func (*BoltDocService) Get added in v1.15.0

func (*BoltDocService) Query added in v1.15.0

func (s *BoltDocService) Query(ctx context.Context, collection *document.Collection, expressions []document.QueryExpression, limit int, pagingToken map[string]string) (*document.QueryResult, error)

func (*BoltDocService) QueryStream added in v1.15.0

func (s *BoltDocService) QueryStream(ctx context.Context, collection *document.Collection, expressions []document.QueryExpression, limit int) document.DocumentIterator

func (*BoltDocService) Set added in v1.15.0

func (s *BoltDocService) Set(ctx context.Context, key *document.Key, content map[string]interface{}) error

type BucketNotification added in v1.18.0

type BucketNotification struct {
	Bucket                   string
	NotificationType         v1.BucketNotificationType
	NotificationPrefixFilter string
}

type DevQueueService added in v1.15.0

type DevQueueService struct {
	queue.UnimplementedQueuePlugin
	// contains filtered or unexported fields
}

func (*DevQueueService) Complete added in v1.15.0

func (s *DevQueueService) Complete(ctx context.Context, queue string, leaseId string) error

Completes a previously popped queue item

func (*DevQueueService) Receive added in v1.15.0

func (s *DevQueueService) Receive(ctx context.Context, options queue.ReceiveOptions) ([]queue.NitricTask, error)

func (*DevQueueService) Send added in v1.15.0

func (s *DevQueueService) Send(ctx context.Context, queue string, task queue.NitricTask) error

func (*DevQueueService) SendBatch added in v1.15.0

type DevSecretService added in v1.15.0

type DevSecretService struct {
	secret.UnimplementedSecretPlugin
	// contains filtered or unexported fields
}

func (*DevSecretService) Access added in v1.15.0

func (*DevSecretService) Put added in v1.15.0

type Function

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

func FunctionsFromHandlers

func FunctionsFromHandlers(p *project.Project) ([]*Function, error)

func (*Function) Name

func (f *Function) Name() string

func (*Function) Start

func (f *Function) Start(envMap map[string]string) error

func (*Function) Stop

func (f *Function) Stop() error

type FunctionOpts

type FunctionOpts struct {
	Name            string
	ProjectName     string
	Handler         string
	RunCtx          string
	Runtime         runtime.Runtime
	ContainerEngine containerengine.ContainerEngine
}

type HttpMiddleware

type HttpMiddleware func(*fasthttp.RequestCtx, pool.WorkerPool) bool

type Item added in v1.15.0

type Item struct {
	ID   int `storm:"id,increment"` // primary key with auto increment
	Data []byte
}

type LocalServices

type LocalServices interface {
	Start(pool pool.WorkerPool, suppressLogs bool) error
	Stop() error
	Running() bool
	Status() *LocalServicesStatus
	Refresh() error
	Apis() map[string]string
	HttpWorkers() map[int]string
	Websockets() map[string]string
	TriggerAddress() string
	GetWorkerPool() pool.WorkerPool
	GetStorageService() *RunStorageService
	GetDashboard() *dashboard.Dashboard
}

func NewLocalServices

func NewLocalServices(project *project.Project, isStart bool, dashboard *dashboard.Dashboard) LocalServices

type LocalServicesStatus

type LocalServicesStatus struct {
	RunDir string `yaml:"runDir"`
	// GatewayAddress  string `yaml:"gatewayAddress"`
	MembraneAddress string `yaml:"membraneAddress"`
	StorageEndpoint string `yaml:"storageEndpoint"`
}

type RunProcessPool

type RunProcessPool struct {
	pool.WorkerPool
	// contains filtered or unexported fields
}

func NewRunProcessPool

func NewRunProcessPool() *RunProcessPool

func (*RunProcessPool) AddWorker

func (r *RunProcessPool) AddWorker(w worker.Worker) error

func (*RunProcessPool) Listen

func (r *RunProcessPool) Listen(l WorkerListener)

func (*RunProcessPool) RemoveWorker

func (r *RunProcessPool) RemoveWorker(w worker.Worker) error

type RunResourcesService added in v1.14.0

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

func (*RunResourcesService) Declare added in v1.18.0

func (*RunResourcesService) Details added in v1.14.0

type RunStackState

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

func NewStackState

func NewStackState(proj *project.Project) *RunStackState

func (*RunStackState) ApiTable

func (r *RunStackState) ApiTable(port int) (table.Model, int)

func (*RunStackState) BucketNotificationsTable added in v1.18.0

func (r *RunStackState) BucketNotificationsTable() (table.Model, int)

func (*RunStackState) DashboardTable added in v1.16.0

func (r *RunStackState) DashboardTable(port int) table.Model

func (*RunStackState) HttpTable added in v1.24.0

func (r *RunStackState) HttpTable() (table.Model, int)

func (*RunStackState) SchedulesTable

func (r *RunStackState) SchedulesTable() (table.Model, int)

func (*RunStackState) Tables added in v1.12.0

func (r *RunStackState) Tables() []table.Model

func (*RunStackState) TopicTable

func (r *RunStackState) TopicTable() (table.Model, int)

func (*RunStackState) Update added in v1.14.1

func (r *RunStackState) Update(workerPool pool.WorkerPool, ls LocalServices)

func (*RunStackState) Warnings added in v1.24.0

func (r *RunStackState) Warnings() []string

func (*RunStackState) WebsocketsTable added in v1.25.0

func (r *RunStackState) WebsocketsTable(port int) (table.Model, int)

type RunStorageService added in v1.11.0

type RunStorageService struct {
	storage.StorageService
	// contains filtered or unexported fields
}

func NewStorage added in v1.11.0

func NewStorage(opts StorageOptions, pool pool.WorkerPool) (*RunStorageService, error)

func (*RunStorageService) Delete added in v1.11.0

func (r *RunStorageService) Delete(ctx context.Context, bucket string, key string) error

func (*RunStorageService) ListFiles added in v1.11.0

func (r *RunStorageService) ListFiles(ctx context.Context, bucket string, options *storage.ListFileOptions) ([]*storage.FileInfo, error)

func (*RunStorageService) PreSignUrl added in v1.11.0

func (r *RunStorageService) PreSignUrl(ctx context.Context, bucket string, key string, operation storage.Operation, expiry uint32) (string, error)

func (*RunStorageService) Read added in v1.11.0

func (r *RunStorageService) Read(ctx context.Context, bucket string, key string) ([]byte, error)

func (*RunStorageService) Write added in v1.11.0

func (r *RunStorageService) Write(ctx context.Context, bucket string, key string, object []byte) error

type RunWebsocketService added in v1.25.0

type RunWebsocketService struct {
	nitricws.WebsocketService
	// contains filtered or unexported fields
}

func NewRunWebsocketService added in v1.25.0

func NewRunWebsocketService(dash *dashboard.Dashboard) (*RunWebsocketService, error)

func (*RunWebsocketService) Close added in v1.25.0

func (r *RunWebsocketService) Close(ctx context.Context, socket string, connectionId string) error

func (*RunWebsocketService) RegisterConnection added in v1.25.0

func (r *RunWebsocketService) RegisterConnection(socket string, connectionId string, connection *websocket.Conn) error

func (*RunWebsocketService) Send added in v1.25.0

func (r *RunWebsocketService) Send(ctx context.Context, socket string, connectionId string, message []byte) error

type SeaweedServer added in v1.14.0

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

func NewSeaweed added in v1.14.0

func NewSeaweed(runDir string) (*SeaweedServer, error)

func (*SeaweedServer) GetApiPort added in v1.14.0

func (m *SeaweedServer) GetApiPort() int

func (*SeaweedServer) Start added in v1.14.0

func (m *SeaweedServer) Start() error

Start - Start the local SeaweedFS server

func (*SeaweedServer) Stop added in v1.14.0

func (m *SeaweedServer) Stop() error

type StorageOptions added in v1.14.0

type StorageOptions struct {
	AccessKey string
	SecretKey string
	Endpoint  string
}

type WorkerEvent

type WorkerEvent struct {
	Type   WorkerEventType
	Worker worker.Worker
}

type WorkerEventType

type WorkerEventType string
const (
	WorkerEventType_Add    WorkerEventType = "add"
	WorkerEventType_Remove WorkerEventType = "remove"
)

type WorkerListener

type WorkerListener = func(WorkerEvent)

type WorkerPoolEventService

type WorkerPoolEventService struct {
	events.UnimplementedEventsPlugin
	// contains filtered or unexported fields
}

func (*WorkerPoolEventService) Publish

func (s *WorkerPoolEventService) Publish(ctx context.Context, topic string, delay int, event *events.NitricEvent) error

Publish a message to a given topic

Jump to

Keyboard shortcuts

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