bloc

package module
v0.0.0-...-87345f3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 58 Imported by: 0

README

bloc-server

中文

In a global view, bloc's code repo has below relationship: repo_relationship

about bloc-server

responsibility

  1. api server for bloc-frontend
  2. scheduler for trigger flow、function's run, also include schedule retry、handle intercept、timeout...
  3. store data

relied on:

  • mongoDB: Database. Use to store functions、flow、run_record...'s infomation. Tested version: 5.0.5
  • rabbitMQ: MQ. Use to delivery trigger flow/function run msg. Tested version: 3.9.11
  • minio: Object storage. Used to store function run's output data. Tested version: RELEASE.2021-11-24T23-19-33Z
  • influxDB: Time series database. Used to store logs. Tested version: 2.1.1

how to run bloc-server

if you just want a local bloc environment(include both upper requirements、bloc-server、bloc-frontend)which can be used to receive your function's register and provide frontend ui. Just follow this tutorial.

  • after deployed above requirement, you can start up bloc-server by:
    $ go run cmd/server/main.go --app_name="$your_app_name" --rabbitMQ_connection_str="$rabbit_user:$rabbit_password@$rabbitMQ_server_address" --minio_connection_str="$minio_user:$minio_password@$mioio_server_address" --mongo_connection_str="$mongodb_user:$mongodb_password@$mongodb_address" --influxdb_connection_str="$influxDB_user:$influxDB_password@$influxDB_address/?token=$influxDB_token&organization=bloc
    

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlocApp

type BlocApp struct {
	Name string // 构建的项目名称

	sync.Mutex
	// contains filtered or unexported fields
}

func NewBlocApp

func NewBlocApp(appName string) *BlocApp

func (*BlocApp) CreateFunctionRunLogger

func (bA *BlocApp) CreateFunctionRunLogger(funcRunRecordID value_object.UUID) *log.Logger

func (*BlocApp) CrontabWatcher

func (blocApp *BlocApp) CrontabWatcher()

CrontabWatcher 分钟接别的观测配置了crontab的flow并进行发起

func (*BlocApp) FlowTaskFinishedConsumer

func (blocApp *BlocApp) FlowTaskFinishedConsumer()

FlowTaskFinishedConsumer receive flow run finished event

func (*BlocApp) FlowTaskStartConsumer

func (blocApp *BlocApp) FlowTaskStartConsumer()

func (*BlocApp) FunctionRunConsumer

func (blocApp *BlocApp) FunctionRunConsumer()

FunctionRunConsumer 接收到要运行的function,主要有以下预操作: 1. 装配ipt具体值 2. 检测是否已超时 3. 都没问题发布client能识别的的运行消息

func (*BlocApp) GetConfigBuilder

func (bloc *BlocApp) GetConfigBuilder() *ConfigBuilder

GetConfigBuilder

func (*BlocApp) GetFunctionByRepoID

func (bA *BlocApp) GetFunctionByRepoID(functionRepoID value_object.UUID) *aggregate.Function

func (*BlocApp) GetOrCreateConsumerObjectStorage

func (bA *BlocApp) GetOrCreateConsumerObjectStorage() object_storage.ObjectStorage

func (*BlocApp) GetOrCreateEventMQ

func (bA *BlocApp) GetOrCreateEventMQ() mq.MsgQueue

func (*BlocApp) GetOrCreateFlowRepository

func (bA *BlocApp) GetOrCreateFlowRepository() flow_repository.FlowRepository

func (*BlocApp) GetOrCreateFlowRunRecordRepository

func (bA *BlocApp) GetOrCreateFlowRunRecordRepository() flowRunRecord_repository.FlowRunRecordRepository

func (*BlocApp) GetOrCreateFunctionRepository

func (bA *BlocApp) GetOrCreateFunctionRepository() function_repository.FunctionRepository

func (*BlocApp) GetOrCreateFunctionRunRecordRepository

func (bA *BlocApp) GetOrCreateFunctionRunRecordRepository() funcRunRec_repository.FunctionRunRecordRepository

func (*BlocApp) GetOrCreateFutureEventStorage

func (bA *BlocApp) GetOrCreateFutureEventStorage() event.FuturePubEventStorage

func (*BlocApp) GetOrCreateHttpLogger

func (bA *BlocApp) GetOrCreateHttpLogger() *log.Logger

func (*BlocApp) GetOrCreateLogBackEnd

func (bA *BlocApp) GetOrCreateLogBackEnd() (log_collect_backend.LogBackEnd, error)

func (*BlocApp) GetOrCreateScheduleLogger

func (bA *BlocApp) GetOrCreateScheduleLogger() *log.Logger

func (*BlocApp) GetOrCreateUserRepository

func (bA *BlocApp) GetOrCreateUserRepository() user_repository.UserRepository

func (*BlocApp) HttpAddress

func (bA *BlocApp) HttpAddress() string

func (*BlocApp) HttpListener

func (bA *BlocApp) HttpListener() net.Listener

func (*BlocApp) InitialUserInfo

func (bA *BlocApp) InitialUserInfo() (name, rawPassword string)

func (*BlocApp) RePubDeadRuns

func (blocApp *BlocApp) RePubDeadRuns()

RePubDeadRuns 重发运行中断的任务

func (*BlocApp) Run

func (bA *BlocApp) Run()

func (*BlocApp) RunHttpServer

func (blocApp *BlocApp) RunHttpServer()

func (*BlocApp) RunScheduler

func (blocApp *BlocApp) RunScheduler()

type ConfigBuilder

type ConfigBuilder struct {
	DefaultUserConf *DefaultUserConfig
	HttpServerConf  *HttpServerConfig
	RabbitConf      *rabbit_conn.RabbitConfig

	InfluxDBConf *influxdb.InfluxDBConfig
	LogConf      *LogConfig
	// contains filtered or unexported fields
}

func (*ConfigBuilder) BuildUp

func (congbder *ConfigBuilder) BuildUp()

BuildUp 对于必须要输入的做输入检查 & 有效性检查

func (*ConfigBuilder) SetDefaultUser

func (confbder *ConfigBuilder) SetDefaultUser(name, password string) *ConfigBuilder

func (*ConfigBuilder) SetHttpServer

func (confbder *ConfigBuilder) SetHttpServer(ip string, port int) *ConfigBuilder

func (*ConfigBuilder) SetInfluxDBConfig

func (confbder *ConfigBuilder) SetInfluxDBConfig(
	user, password, address, organization, token string,
) *ConfigBuilder

func (*ConfigBuilder) SetLogConfig

func (confbder *ConfigBuilder) SetLogConfig(maxKeepDays int) *ConfigBuilder

func (*ConfigBuilder) SetMinioConfig

func (confbder *ConfigBuilder) SetMinioConfig(
	bucketName string, addresses []string, key, password string) *ConfigBuilder

func (*ConfigBuilder) SetMongoConfig

func (confbder *ConfigBuilder) SetMongoConfig(
	user, password string,
	addresses []string,
	defaultDB, replicaSetName, authSource string,
) *ConfigBuilder

func (*ConfigBuilder) SetRabbitConfig

func (confbder *ConfigBuilder) SetRabbitConfig(
	user, password string, host []string, vHost string,
) *ConfigBuilder

type DefaultUserConfig

type DefaultUserConfig struct {
	Name     string
	Password string
}

func (*DefaultUserConfig) IsNil

func (dUC *DefaultUserConfig) IsNil() bool

type HttpServerConfig

type HttpServerConfig struct {
	IP   string
	Port int
}

func (*HttpServerConfig) HttpAddress

func (hSC *HttpServerConfig) HttpAddress() string

type LogConfig

type LogConfig struct {
	MaxKeepDays int
}

func (*LogConfig) IsNil

func (lF *LogConfig) IsNil() bool

Jump to

Keyboard shortcuts

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