Documentation
¶
Overview ¶
Package client provides mieru client APIs for third party applications to integrate mieru protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { ClientConfigurationService ClientLifecycleService ClientNetworkService }
Client contains methods supported by a mieru client.
type ClientConfig ¶
type ClientConfig struct { Profile *appctlpb.ClientProfile // A dialer to connect to proxy server via stream-oriented network connections. // If this field is not set, a default dialer is used. Dialer apicommon.Dialer // If set, the resolver translates proxy server domain name into IP addresses. // This field is not required, if Dialer is able to do DNS, or proxy server // endpoints are IP addresses rather than domain names. Resolver apicommon.DNSResolver }
ClientConfig stores proxy client configuration.
type ClientConfigurationService ¶
type ClientConfigurationService interface { // Load returns the client config. // It returns ErrNoClientConfig if client config is never stored. Load() (*ClientConfig, error) // Store saves the client config. // It returns wrapped ErrInvalidConfigConfig error // if the provided client config is invalid. // It returns ErrStoreClientConfigAfterStart error // if it is called after start. Store(*ClientConfig) error }
ClientConfigurationService contains methods to manage proxy client configuration.
type ClientLifecycleService ¶
type ClientLifecycleService interface { // Start activates the client with the stored configuration. // Calling Start function more than once has undefined behavior. Start() error // Stop deactivates the client. // Established network connections are NOT terminated. // After stop, the client can't be reused. Stop() error // IsRunning returns true if the client has been started // and has not been stopped. IsRunning() bool }
ClientLifecycleService contains methods to manage proxy client lifecycle.
type ClientNetworkService ¶
type ClientNetworkService interface { // DialContext returns a new proxy connection to reach the destination. // It uses the dialer in ClientConfig to connect to a proxy server endpoint. // It returns an error if the client has not been started, // or has been stopped. DialContext(context.Context, net.Addr) (net.Conn, error) }
ClientNetworkService contains methods to establish connections to destinations using proxy servers.
Click to show internal directories.
Click to hide internal directories.