go-core/pkg/module/context.go

38 lines
645 B
Go
Raw Permalink Normal View History

2023-01-25 13:56:13 +03:00
// Copyright 2022 Listware
package module
import (
"encoding/json"
"github.com/apache/flink-statefun/statefun-sdk-go/v3/pkg/statefun"
)
type Context interface {
statefun.Context
Message() json.RawMessage
States() []statefun.ValueSpec
CmdbContext() json.RawMessage
}
type contextAdapter struct {
statefun.Context
message json.RawMessage
states []statefun.ValueSpec
cmdbContext json.RawMessage
}
func (c *contextAdapter) Message() json.RawMessage {
return c.message
}
func (c *contextAdapter) States() []statefun.ValueSpec {
return c.states
}
func (c *contextAdapter) CmdbContext() json.RawMessage {
return c.cmdbContext
}