sdsc

package
v0.0.0-...-f2677c2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package sdsc includes a lightweight testing client to interact with SDS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateResponse

func ValidateResponse(response *discovery.DiscoveryResponse) error

ValidateResponse validates the SDS response. TODO(incfly): add more check around cert.

Types

type Client

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

Client is a lightweight client for testing secret discovery service server.

func NewClient

func NewClient(opt ClientOptions) (*Client, error)

NewClient returns a sds client for testing.

func (*Client) Send

func (c *Client) Send() error

Send sends a request to the agent.

func (*Client) Start

func (c *Client) Start()

Start starts sds client to receive the scecret updates from the server.

func (*Client) Stop

func (c *Client) Stop() error

Stop stops the sds client.

func (*Client) WaitForUpdate

func (c *Client) WaitForUpdate(duration time.Duration) (*discovery.DiscoveryResponse, error)

WaitForUpdate blocks until the error occurs or updates are pushed from the sds server.

type ClientOptions

type ClientOptions struct {
	// unix://var/run/sds/, localhost:15000
	// https://github.com/grpc/grpc/blob/master/doc/naming.md#name-syntax
	ServerAddress string
}

ClientOptions contains the options for the SDS testing.

Jump to

Keyboard shortcuts

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