service

package
v1.14.0-dev.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REST    protocol = "rest"
	GRPC    protocol = "grpc"
	MSGPACK protocol = "msgpack-rpc"
)
View Source
const (
	PROTOBUFF  schema = "protobuf"
	SCHEMALESS schema = ""
)

Variables

This section is empty.

Functions

func NewExecutor

func NewExecutor(i *interfaceInfo) (executor, error)

NewExecutor Each interface definition maps to one executor instance. It is supposed to have only one thread running.

func ProtoParser

func ProtoParser() *protoparse.Parser

Types

type ExternalFunc

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

func (*ExternalFunc) Exec

func (f *ExternalFunc) Exec(args []interface{}, ctx api.FunctionContext) (interface{}, bool)

func (*ExternalFunc) IsAggregate

func (f *ExternalFunc) IsAggregate() bool

func (*ExternalFunc) Validate

func (f *ExternalFunc) Validate(_ []interface{}) error

type Manager

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

func GetManager

func GetManager() *Manager

func InitManager

func InitManager() (*Manager, error)

func (*Manager) ConvName

func (m *Manager) ConvName(funcName string) (string, bool)

func (*Manager) Create

func (m *Manager) Create(r *ServiceCreationRequest) error

func (*Manager) Delete

func (m *Manager) Delete(name string) error

func (*Manager) Function

func (m *Manager) Function(name string) (api.Function, error)

func (*Manager) FunctionPluginInfo

func (m *Manager) FunctionPluginInfo(funcName string) (plugin.EXTENSION_TYPE, string, string)

func (*Manager) Get

func (m *Manager) Get(name string) (*serviceInfo, error)

func (*Manager) GetAllServices

func (m *Manager) GetAllServices() map[string]string

func (*Manager) GetAllServicesStatus

func (m *Manager) GetAllServicesStatus() map[string]string

func (*Manager) GetFunction

func (m *Manager) GetFunction(name string) (*functionContainer, error)

func (*Manager) HasFunctionSet

func (m *Manager) HasFunctionSet(_ string) bool

func (*Manager) HasService

func (m *Manager) HasService(name string) bool

func (*Manager) ImportPartialServices

func (m *Manager) ImportPartialServices(services map[string]string) map[string]string

func (*Manager) ImportServices

func (m *Manager) ImportServices(services map[string]string) map[string]string

func (*Manager) InitByFiles

func (m *Manager) InitByFiles() error

InitByFiles *

  • This function will parse the service definition json files in etc/services.
  • It will validate all json files and their schemaFiles. If invalid, it just prints
  • an error log and ignore. So it is possible that only valid service definition are
  • parsed and available. *
  • NOT threadsafe, must run in lock

func (*Manager) List

func (m *Manager) List() ([]string, error)

func (*Manager) ListFunctions

func (m *Manager) ListFunctions() ([]*functionContainer, error)

func (*Manager) UninstallAllServices

func (m *Manager) UninstallAllServices()

func (*Manager) Update

func (m *Manager) Update(req *ServiceCreationRequest) error

type ServiceCreationRequest

type ServiceCreationRequest struct {
	Name string `json:"name"`
	File string `json:"file"`
}

func (*ServiceCreationRequest) InstallScript

func (s *ServiceCreationRequest) InstallScript() string

Jump to

Keyboard shortcuts

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