runtime

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultInitRuntimeStage added in v0.4.0

func DefaultInitRuntimeStage(o *runtimeOptions, m *MosnRuntime) error

Types

type AppConfig

type AppConfig struct {
	AppId            string `json:"app_id"`
	GrpcCallbackPort int    `json:"grpc_callback_port"`
	GrpcCallbackHost string `json:"grpc_callback_host"`
}

type ErrInterceptor

type ErrInterceptor func(err error, format string, args ...interface{})

type ExtensionComponentConfig added in v0.5.0

type ExtensionComponentConfig struct {
	// "mosn.io/layotto/spec/proto/extension/v1/cryption"
	// cryption.
	CryptionService map[string]cryption.Config `json:"cryption"`

	// "mosn.io/layotto/spec/proto/extension/v1/email"
	// email.
	EmailService map[string]email.Config `json:"email"`

	// "mosn.io/layotto/spec/proto/extension/v1/phone"
	// phone.
	PhoneCallService map[string]phone.Config `json:"phone"`

	// "mosn.io/layotto/spec/proto/extension/v1/sms"
	// sms.
	SmsService map[string]sms.Config `json:"sms"`
}

type MosnRuntime

type MosnRuntime struct {
	Injector *ref.DefaultInjector

	// app callback
	AppCallbackConn *rawGRPC.ClientConn
	// contains filtered or unexported fields
}

func NewMosnRuntime

func NewMosnRuntime(runtimeConfig *MosnRuntimeConfig) *MosnRuntime

func (*MosnRuntime) AppendInitRuntimeStage added in v0.4.0

func (m *MosnRuntime) AppendInitRuntimeStage(f initRuntimeStage)

func (*MosnRuntime) GetInfo

func (m *MosnRuntime) GetInfo() *info.RuntimeInfo

func (*MosnRuntime) Run

func (m *MosnRuntime) Run(opts ...Option) (mgrpc.RegisteredServer, error)

func (*MosnRuntime) RuntimeConfig added in v0.4.0

func (m *MosnRuntime) RuntimeConfig() *MosnRuntimeConfig

func (*MosnRuntime) SetCustomComponent added in v0.4.0

func (m *MosnRuntime) SetCustomComponent(kind string, name string, component custom.Component)

func (*MosnRuntime) Stop

func (m *MosnRuntime) Stop()

type MosnRuntimeConfig

type MosnRuntimeConfig struct {
	AppManagement          AppConfig                           `json:"app"`
	HelloServiceManagement map[string]hello.HelloConfig        `json:"hellos"`
	ConfigStoreManagement  map[string]configstores.StoreConfig `json:"config_store"`
	RpcManagement          map[string]rpc.RpcConfig            `json:"rpcs"`
	PubSubManagement       map[string]pubsub.Config            `json:"pub_subs"`
	StateManagement        map[string]state.Config             `json:"state"`
	Files                  map[string]file.FileConfig          `json:"file"`
	Oss                    map[string]oss.Config               `json:"oss"`
	LockManagement         map[string]lock.Config              `json:"lock"`
	SequencerManagement    map[string]sequencer.Config         `json:"sequencer"`
	Bindings               map[string]bindings.Metadata        `json:"bindings"`
	SecretStoresManagement map[string]secretstores.Metadata    `json:"secret_store"`
	// <component type,component name,config>
	// e.g. <"super_pubsub","etcd",config>
	CustomComponent map[string]map[string]custom.Config `json:"custom_component,omitempty"`
	Extends         map[string]json.RawMessage          `json:"extends,omitempty"` // extend config
	ExtensionComponentConfig
}

func ParseRuntimeConfig

func ParseRuntimeConfig(data json.RawMessage) (*MosnRuntimeConfig, error)

type Option

type Option func(o *runtimeOptions)

func WithConfigStoresFactory

func WithConfigStoresFactory(configStores ...*configstores.StoreFactory) Option

func WithCryptionServiceFactory added in v0.5.0

func WithCryptionServiceFactory(cryption ...*cryption.Factory) Option

func WithCustomComponentFactory added in v0.4.0

func WithCustomComponentFactory(kind string, factorys ...*custom.ComponentFactory) Option

func WithEmailServiceFactory added in v0.5.0

func WithEmailServiceFactory(email ...*email.Factory) Option

func WithErrInterceptor

func WithErrInterceptor(i ErrInterceptor) Option

func WithExtensionGrpcAPI added in v0.5.0

func WithExtensionGrpcAPI() Option

func WithFileFactory added in v0.2.0

func WithFileFactory(files ...*file.FileFactory) Option

func WithGrpcAPI added in v0.4.0

func WithGrpcAPI(apiFuncs ...rgrpc.NewGrpcAPI) Option

func WithGrpcOptions

func WithGrpcOptions(options ...grpc.ServerOption) Option

func WithHelloFactory

func WithHelloFactory(hellos ...*hello.HelloFactory) Option

func WithInputBindings added in v0.2.0

func WithInputBindings(factorys ...*mbindings.InputBindingFactory) Option

WithInputBindings adds input binding components to the runtime.

func WithLockFactory

func WithLockFactory(factorys ...*runtime_lock.Factory) Option

func WithNewServer

func WithNewServer(f rgrpc.NewServer) Option

func WithOssFactory added in v0.5.0

func WithOssFactory(oss ...*oss.Factory) Option

func WithOutputBindings added in v0.2.0

func WithOutputBindings(factorys ...*mbindings.OutputBindingFactory) Option

WithOutputBindings adds output binding components to the runtime.

func WithPhoneCallServiceFactory added in v0.5.0

func WithPhoneCallServiceFactory(phone ...*phone.Factory) Option

func WithPubSubFactory

func WithPubSubFactory(factorys ...*pubsub.Factory) Option

func WithRpcFactory

func WithRpcFactory(rpcs ...*rpc.Factory) Option

func WithSecretStoresFactory added in v0.4.0

func WithSecretStoresFactory(factorys ...*msecretstores.SecretStoresFactory) Option

func WithSequencerFactory

func WithSequencerFactory(factorys ...*runtime_sequencer.Factory) Option

func WithSmsServiceFactory added in v0.5.0

func WithSmsServiceFactory(sms ...*sms.Factory) Option

func WithStateFactory

func WithStateFactory(factorys ...*state.Factory) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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