applier

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Terminal Applier do not make any change to the message
	Terminal = ApplyFunc(func(ctx context.Context, msg *isb.ReadMessage) ([]*isb.Message, error) {
		return []*isb.Message{&msg.Message}, nil
	})
)

Functions

This section is empty.

Types

type Applier

type Applier interface {
	Apply(ctx context.Context, message *isb.ReadMessage) ([]*isb.Message, error)
}

Applier applies the HTTPBasedUDF on the read message and gives back a new message. Any UserError will be retried here, while InternalErr can be returned and could be retried by the callee.

type ApplyFunc

type ApplyFunc func(context.Context, *isb.ReadMessage) ([]*isb.Message, error)

ApplyFunc untility function used to create a Applier implementation

func (ApplyFunc) Apply

func (a ApplyFunc) Apply(ctx context.Context, message *isb.ReadMessage) ([]*isb.Message, error)

type ApplyUDFErr

type ApplyUDFErr struct {
	UserUDFErr bool
	Message    string
	InternalErr
}

ApplyUDFErr represents any UDF related error

func (ApplyUDFErr) Error

func (e ApplyUDFErr) Error() string

func (ApplyUDFErr) IsInternalErr

func (e ApplyUDFErr) IsInternalErr() bool

IsInternalErr is true if this is a platform issue. This is a blocking error.

func (ApplyUDFErr) IsUserUDFErr

func (e ApplyUDFErr) IsUserUDFErr() bool

IsUserUDFErr is true if the problem is due to the user code in the UDF.

type InternalErr

type InternalErr struct {
	Flag        bool
	MainCarDown bool
}

InternalErr represents errors internal to the platform

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option to apply different options

func WithHTTPClientTimeout

func WithHTTPClientTimeout(t time.Duration) Option

WithHTTPClientTimeout sets timeout for the HTTP Client

type UDSHTTPBasedUDF

type UDSHTTPBasedUDF struct {
	// contains filtered or unexported fields
}

UDSHTTPBasedUDF applies user defined function over HTTP (over Unix Domain Socket) client/server where server is the UDF.

func NewUDSHTTPBasedUDF

func NewUDSHTTPBasedUDF(socketPath string, opts ...Option) *UDSHTTPBasedUDF

NewUDSHTTPBasedUDF returns UDSHTTPBasedUDF. Parameter - socketPath, Unix Domain Socket path

func (*UDSHTTPBasedUDF) Apply

func (u *UDSHTTPBasedUDF) Apply(ctx context.Context, readMessage *isb.ReadMessage) ([]*isb.Message, error)

Apply applies the user defined function.

func (*UDSHTTPBasedUDF) WaitUntilReady

func (u *UDSHTTPBasedUDF) WaitUntilReady(ctx context.Context) error

WaitUntilReady waits till the readyURL is available

Jump to

Keyboard shortcuts

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