adminclient

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 17 Imported by: 2

Documentation

Overview

package adminclient provides a client for the Kwil admin service. The admin service is used to perform node administrative actions, such as submitting validator transactions, retrieving node status, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminClient

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

AdminClient is a client for the Kwil admin service. It inherits both the admin and tx services.

func NewClient

func NewClient(ctx context.Context, target string, opts ...Opt) (*AdminClient, error)

NewClient creates a new admin client . The target arg is usually either "127.0.0.1:8485" or "/path/to/socket.socket". The scheme http:// or https:// may be included, to dictate if TLS is required or not. If no scheme is given, http:// is assumed. UNIX socket transport may not use TLS. The endpoint path is a separate argument to distinguish it from the UNIX socket file path.

For example,

adminclient.NewClient(ctx, "/run/kwild.sock")

type Opt added in v0.2.0

type Opt func(*AdminClient)

func WithLogger

func WithLogger(logger log.Logger) Opt

WithLogger sets the logger for the admin client.

func WithPass added in v0.3.0

func WithPass(pass string) Opt

WithPass specifies a password to use, if password authentication is enable on the server.

func WithTLS

func WithTLS(kwildCertFile, clientKeyFile, clientCertFile string) Opt

WithTLS provides the required files for the admin client to use TLS, and possibly client authenticated TLS. kwildCertFile may be omitted if the service is issued a TLS certificate by a root CA. The client files may be omitted if not using TLS for client authentication, only for transport encryption and server authentication. The server must be configured appropriately.

Jump to

Keyboard shortcuts

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