common

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EcflowClientData

type EcflowClientData struct {
	Command    string              `json:"command"`
	Arguments  []string            `json:"args"`
	Envs       []map[string]string `json:"envs"`
	EcflowHost string              `json:"ecf_host"`
	EcflowPort string              `json:"ecf_port"`
	NodeName   string              `json:"ecf_name"`
	NodeRID    string              `json:"ecf_rid"`
	TryNo      string              `json:"ecf_tryno"`
	EcfDate    string              `json:"ecf_date"`
}

func CreateEcflowClientMessage

func CreateEcflowClientMessage(commandOptions string) (*EcflowClientData, error)

func (*EcflowClientData) ParseCommandOptions

func (d *EcflowClientData) ParseCommandOptions(commandOptions string)

type EpsProductionData added in v0.2.0

type EpsProductionProperties added in v0.3.0

type EpsProductionProperties struct {
	StartTime    time.Time `json:"start_time"`    // start time, YYYYMMDDHH
	ForecastTime string    `json:"forecast_time"` // time duration, such as 3h, 12h, 120h
	Number       int       `json:"number"`
}

type EventMessage

type EventMessage struct {
	App  string      `json:"app"`  // app name
	Type string      `json:"type"` // type
	Time time.Time   `json:"time"` // time string, RFC 3339
	Data interface{} `json:"data"` // data structure
}

type EventStatus

type EventStatus int
const (
	Unknown   EventStatus = 0
	Complete  EventStatus = 1
	Queued    EventStatus = 2
	Aborted   EventStatus = 3
	Submitted EventStatus = 4
	Active    EventStatus = 5
	Suspended EventStatus = 6
)

func ToEventStatus

func ToEventStatus(status string) EventStatus

func (EventStatus) String

func (status EventStatus) String() string

type MessageBrokerServer

type MessageBrokerServer struct {
	pb.MessageBrokerServer
	DisableDeliver bool
	BrokerMode     string
	MessageChan    chan RabbitMQMessage
}

func (*MessageBrokerServer) SendKafkaMessage added in v0.6.0

func (s *MessageBrokerServer) SendKafkaMessage(
	ctx context.Context,
	req *pb.KafkaMessage,
) (*pb.Response, error)

func (*MessageBrokerServer) SendRabbitMQMessage

func (s *MessageBrokerServer) SendRabbitMQMessage(
	ctx context.Context,
	req *pb.RabbitMQMessage,
) (*pb.Response, error)

type OperationProductionData added in v0.2.0

type OperationProductionData struct {
	ProductionInfo
	OperationProductionProperties
	ProductionEventStatus
}

type OperationProductionProperties added in v0.3.0

type OperationProductionProperties struct {
	StartTime    time.Time `json:"start_time"`    // start time, YYYYMMDDHH
	ForecastTime string    `json:"forecast_time"` // time duration, such as 3h, 12h, 120h
}

type ProductionEvent added in v0.2.0

type ProductionEvent string
const (
	ProductionEventStorage ProductionEvent = "storage"
)

type ProductionEventStatus added in v0.2.0

type ProductionEventStatus struct {
	Event  ProductionEvent `json:"event"`  // production event, storage
	Status EventStatus     `json:"status"` // unknown, complete, queued, aborted, submitted, active, suspended
}

type ProductionInfo added in v0.2.0

type ProductionInfo struct {
	System string           `json:"system"` // system name: grapes_gfs_gmf, grapes_gfs_gda
	Stream ProductionStream `json:"stream"` // stream: oper, eps, ...
	Type   ProductionType   `json:"type"`   // production type: grib2
	Name   ProductionName   `json:"name"`   // production name, orig, ...
}

type ProductionName added in v0.3.0

type ProductionName string
const (
	ProductionNameGrib2Orig ProductionName = "orig"
)

type ProductionStream added in v0.2.0

type ProductionStream string
const (
	ProductionStreamOperation ProductionStream = "oper"
	ProductionStreamEPS       ProductionStream = "eps"
)

type ProductionType added in v0.2.0

type ProductionType string
const (
	ProductionTypeObs      ProductionType = "obs"
	ProductionTypeForecast ProductionType = "fcst"
	ProductionTypeGrib2    ProductionType = "grib2"
	ProductionTypeGraph    ProductionType = "graph"
)

type RabbitMQMessage added in v0.6.0

type RabbitMQMessage struct {
	Target  sender.RabbitMQTarget
	Message []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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