Documentation
¶
Index ¶
- Constants
- func ConnectToNATSServer(url string) (*nats.Conn, error)
- func GeneratePortOrDie() int
- func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.EventMeshConfig
- func StartNATSServer() *server.Server
- type CloudEvent
- type CloudEventBuilder
- type CloudEventBuilderOpt
- type EnvConfigOption
- func WithEventTypePrefix(eventTypePrefix string) EnvConfigOption
- func WithMaxIdleConns(maxIdleConns int) EnvConfigOption
- func WithMaxIdleConnsPerHost(maxIdleConnsPerHost int) EnvConfigOption
- func WithNamespace(namespace string) EnvConfigOption
- func WithPort(port int) EnvConfigOption
- func WithRequestTimeout(requestTimeout time.Duration) EnvConfigOption
- type Event
- type LegacyEvent
- type LegacyEventBuilder
- type LegacyEventBuilderOpt
- func WithLegacyEventData(data string) LegacyEventBuilderOpt
- func WithLegacyEventID(id string) LegacyEventBuilderOpt
- func WithLegacyEventTime(eventTime string) LegacyEventBuilderOpt
- func WithLegacyEventType(eventType string) LegacyEventBuilderOpt
- func WithLegacyEventTypeVersion(eventTypeVersion string) LegacyEventBuilderOpt
- type MockServer
- type MockServerOption
- type Validator
Constants ¶
View Source
const ( ApplicationName = "testapp1023" ApplicationNameNotClean = "testapp_1-0+2=3" MessagingNamespace = "/messaging.namespace" Prefix = "prefix" EmptyPrefix = "" EventID = "8945ec08-256b-11eb-9928-acde48001122" EventData = `{\"key\":\"value\"}` EventName = "order.created" EventVersion = "v1" CloudEventNameAndVersion = EventName + "." + EventVersion CloudEventType = ApplicationName + "." + CloudEventNameAndVersion CloudEventTypeNotClean = ApplicationNameNotClean + "." + CloudEventNameAndVersion CloudEventTypeWithPrefix = Prefix + "." + CloudEventType CloudEventTypeWithPrefixNotClean = Prefix + "." + CloudEventTypeNotClean CloudEventSource = "/default/sap.kyma/id" CloudEventSpecVersion = "1.0" LegacyEventTime = "2020-04-02T21:37:00Z" OldEventTypePrefix = "sap.kyma.custom" )
View Source
const ( CeIDHeader = "ce-id" CeTypeHeader = "ce-type" CeSourceHeader = "ce-source" CeSpecVersionHeader = "ce-specversion" )
binary cloudevent headers.
View Source
const (
StreamName = "kyma"
)
Variables ¶
This section is empty.
Functions ¶
func ConnectToNATSServer ¶
func GeneratePortOrDie ¶
func GeneratePortOrDie() int
GeneratePortOrDie generates a random 5 digit port or fail.
func NewEnvConfig ¶
func NewEnvConfig(emsCEURL, authURL string, opts ...EnvConfigOption) *env.EventMeshConfig
func StartNATSServer ¶
Types ¶
type CloudEvent ¶
type CloudEvent struct { Event // contains filtered or unexported fields }
type CloudEventBuilder ¶
type CloudEventBuilder struct {
CloudEvent
}
func NewCloudEventBuilder ¶
func NewCloudEventBuilder(opts ...CloudEventBuilderOpt) *CloudEventBuilder
func (*CloudEventBuilder) BuildBinary ¶
func (b *CloudEventBuilder) BuildBinary() (string, http.Header)
func (*CloudEventBuilder) BuildStructured ¶
func (b *CloudEventBuilder) BuildStructured() (string, http.Header)
type CloudEventBuilderOpt ¶
type CloudEventBuilderOpt func(*CloudEventBuilder)
func WithCloudEventID ¶
func WithCloudEventID(id string) CloudEventBuilderOpt
func WithCloudEventSource ¶
func WithCloudEventSource(eventSource string) CloudEventBuilderOpt
func WithCloudEventSpecVersion ¶
func WithCloudEventSpecVersion(specVersion string) CloudEventBuilderOpt
func WithCloudEventType ¶
func WithCloudEventType(eventType string) CloudEventBuilderOpt
type EnvConfigOption ¶
type EnvConfigOption func(e *env.EventMeshConfig)
func WithEventTypePrefix ¶
func WithEventTypePrefix(eventTypePrefix string) EnvConfigOption
func WithMaxIdleConns ¶
func WithMaxIdleConns(maxIdleConns int) EnvConfigOption
func WithMaxIdleConnsPerHost ¶
func WithMaxIdleConnsPerHost(maxIdleConnsPerHost int) EnvConfigOption
func WithNamespace ¶
func WithNamespace(namespace string) EnvConfigOption
func WithPort ¶
func WithPort(port int) EnvConfigOption
func WithRequestTimeout ¶
func WithRequestTimeout(requestTimeout time.Duration) EnvConfigOption
type LegacyEvent ¶
type LegacyEvent struct { Event // contains filtered or unexported fields }
type LegacyEventBuilder ¶
type LegacyEventBuilder struct {
LegacyEvent
}
func NewLegacyEventBuilder ¶
func NewLegacyEventBuilder(opts ...LegacyEventBuilderOpt) *LegacyEventBuilder
type LegacyEventBuilderOpt ¶
type LegacyEventBuilderOpt func(*LegacyEventBuilder)
func WithLegacyEventData ¶
func WithLegacyEventData(data string) LegacyEventBuilderOpt
func WithLegacyEventID ¶
func WithLegacyEventID(id string) LegacyEventBuilderOpt
func WithLegacyEventTime ¶
func WithLegacyEventTime(eventTime string) LegacyEventBuilderOpt
func WithLegacyEventType ¶
func WithLegacyEventType(eventType string) LegacyEventBuilderOpt
func WithLegacyEventTypeVersion ¶
func WithLegacyEventTypeVersion(eventTypeVersion string) LegacyEventBuilderOpt
type MockServer ¶
type MockServer struct {
// contains filtered or unexported fields
}
func NewMockServer ¶
func NewMockServer(opts ...MockServerOption) *MockServer
func (*MockServer) Close ¶
func (m *MockServer) Close()
func (*MockServer) GeneratedTokensCount ¶
func (m *MockServer) GeneratedTokensCount() int
func (*MockServer) Start ¶
func (m *MockServer) Start(t *testing.T, tokenEndpoint, eventsEndpoint, eventsWithHTTP400 string)
func (*MockServer) URL ¶
func (m *MockServer) URL() string
type MockServerOption ¶
type MockServerOption func(m *MockServer)
func WithExpiresIn ¶
func WithExpiresIn(expiresIn int) MockServerOption
func WithResponseTime ¶
func WithResponseTime(responseTime time.Duration) MockServerOption
func WithValidator ¶
func WithValidator(validator Validator) MockServerOption
Click to show internal directories.
Click to hide internal directories.