Documentation ¶
Overview ¶
Package server is a wrapper for the Client gRPC API. It provides a simple interface to interact with and mock.
Index ¶
- type Client
- func (c *Client) GetSetPipelinesCommandByService(ctx context.Context, service string) (*protos.GetSetPipelinesCommandsByServiceResponse, error)
- func (c *Client) GetTailStream(ctx context.Context) (protos.Internal_SendTailClient, error)
- func (c *Client) HeartBeat(ctx context.Context, req *protos.HeartbeatRequest) error
- func (c *Client) NewAudience(ctx context.Context, aud *protos.Audience, sessionID string) error
- func (c *Client) Notify(ctx context.Context, pipeline *protos.Pipeline, step *protos.PipelineStep, ...) error
- func (c *Client) Reconnect() error
- func (c *Client) Register(ctx context.Context, req *protos.RegisterRequest) (protos.Internal_RegisterClient, error)
- func (c *Client) SendMetrics(ctx context.Context, counters []*types.CounterEntry) error
- func (c *Client) SendSchema(ctx context.Context, aud *protos.Audience, jsonSchema []byte) error
- type IServerClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ServerAddr string Token string Conn *grpc.ClientConn Server protos.InternalClient }
func (*Client) GetSetPipelinesCommandByService ¶
func (*Client) GetTailStream ¶
func (*Client) NewAudience ¶
func (*Client) Register ¶
func (c *Client) Register(ctx context.Context, req *protos.RegisterRequest) (protos.Internal_RegisterClient, error)
func (*Client) SendMetrics ¶
type IServerClient ¶
type IServerClient interface { // GetSetPipelinesCommandByService is called in New() in order to get all AttachCommands in a synchronous manner // before we allow the client to start processing. GetSetPipelinesCommandByService(ctx context.Context, service string) (*protos.GetSetPipelinesCommandsByServiceResponse, error) // GetTailStream returns a gRPC client stream used to send TailResponses to the streamdal server GetTailStream(ctx context.Context) (protos.Internal_SendTailClient, error) // HeartBeat sends a heartbeat to the streamdal server HeartBeat(ctx context.Context, req *protos.HeartbeatRequest) error // NewAudience announces a new audience to the streamdal server NewAudience(ctx context.Context, aud *protos.Audience, sessionID string) error // Notify calls to streamdal server to trigger the configured notification rules for the specified step Notify(ctx context.Context, pipeline *protos.Pipeline, step *protos.PipelineStep, aud *protos.Audience, payload []byte, conditionType protos.NotifyRequest_ConditionType) error // Reconnect closes any open gRPC connection to the streamdal server and re-establishes a new connection // This method won't perform retries as that should be determined by the caller Reconnect() error // Register registers a new client with the streamdal server. // This is ran in a goroutine and constantly listens for commands from the streamdal server // such as AttachPipeline, DetachPipeline, etc Register(ctx context.Context, req *protos.RegisterRequest) (protos.Internal_RegisterClient, error) // SendMetrics ships counter(s) to the server SendMetrics(ctx context.Context, counters []*types.CounterEntry) error // SendSchema sends a schema to the streamdal server SendSchema(ctx context.Context, aud *protos.Audience, jsonSchema []byte) error }
Click to show internal directories.
Click to hide internal directories.