rest

package
v0.6.5-rc6 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LeaseShellCodeStdout         = 100
	LeaseShellCodeStderr         = 101
	LeaseShellCodeResult         = 102
	LeaseShellCodeFailure        = 103
	LeaseShellCodeStdin          = 104
	LeaseShellCodeTerminalResize = 105
)

Variables

View Source
var (
	ErrLeaseShellProviderError = fmt.Errorf("%w: the provider encountered an unknown error", errLeaseShell)
)

Functions

func NewJwtServer

func NewJwtServer(ctx context.Context,
	cquery ctypes.QueryClient,
	jwtGatewayAddr string,
	providerAddr sdk.Address,
	cert tls.Certificate,
	certSerialNumber string,
	jwtExpiresAfter time.Duration,
) (*http.Server, error)

func NewResourceServer

func NewResourceServer(ctx context.Context,
	log log.Logger,
	serverAddr string,
	providerAddr sdk.Address,
	pubkey *ecdsa.PublicKey,
	lokiGwAddr string,
) (*http.Server, error)

func NewServer

func NewServer(
	ctx context.Context,
	log log.Logger,
	pclient provider.Client,
	cquery ctypes.QueryClient,
	address string,
	pid sdk.Address,
	certs []tls.Certificate,
	clusterConfig map[interface{}]interface{}) (*http.Server, error)

Types

type AkashNamespace

type AkashNamespace struct {
	V1 *ClaimsV1 `json:"v1"`
}

type ClaimsV1

type ClaimsV1 struct {
	CertSerialNumber string `json:"cert_serial_number"`
}

type Client

type Client interface {
	Status(ctx context.Context) (*provider.Status, error)
	Validate(ctx context.Context, gspec dtypes.GroupSpec) (provider.ValidateGroupSpecResult, error)
	SubmitManifest(ctx context.Context, dseq uint64, mani manifest.Manifest) error
	LeaseStatus(ctx context.Context, id mtypes.LeaseID) (LeaseStatus, error)
	LeaseEvents(ctx context.Context, id mtypes.LeaseID, services string, follow bool) (*LeaseKubeEvents, error)
	LeaseLogs(ctx context.Context, id mtypes.LeaseID, services string, follow bool, tailLines int64) (*ServiceLogs, error)
	ServiceStatus(ctx context.Context, id mtypes.LeaseID, service string) (*cltypes.ServiceStatus, error)
	LeaseShell(ctx context.Context, id mtypes.LeaseID, service string, podIndex uint, cmd []string,
		stdin io.Reader,
		stdout io.Writer,
		stderr io.Writer,
		tty bool,
		tsq <-chan remotecommand.TerminalSize) error
	MigrateHostnames(ctx context.Context, hostnames []string, dseq uint64, gseq uint32) error
	MigrateEndpoints(ctx context.Context, endpoints []string, dseq uint64, gseq uint32) error
}

Client defines the methods available for connecting to the gateway server.

func NewClient

func NewClient(ctx context.Context, qclient aclient.QueryClient, addr sdk.Address, certs []tls.Certificate) (Client, error)

NewClient returns a new Client

type ClientCustomClaims

type ClientCustomClaims struct {
	AkashNamespace *AkashNamespace `json:"https://akash.network/"`
	jwt.RegisteredClaims
}

func (*ClientCustomClaims) Valid

func (c *ClientCustomClaims) Valid() error

type ClientDirectory

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

func NewClientDirectory

func NewClientDirectory(ctx context.Context, cctx cosmosclient.Context) (*ClientDirectory, error)

func (*ClientDirectory) GetClient

func (cd *ClientDirectory) GetClient(providerAddr sdk.Address) (Client, error)

func (*ClientDirectory) GetClientFromBech32

func (cd *ClientDirectory) GetClientFromBech32(providerAddrBech32 string) (Client, error)

type ClientResponseError

type ClientResponseError struct {
	Status  int
	Message string
}

func (ClientResponseError) ClientError

func (err ClientResponseError) ClientError() string

func (ClientResponseError) Error

func (err ClientResponseError) Error() string

type CtxAuthKey

type CtxAuthKey string

type JwtClient

type JwtClient interface {
	GetJWT(ctx context.Context) (*jwt.Token, error)
}

type LeaseKubeEvent

type LeaseKubeEvent struct {
	Action  string `json:"action"`
	Message string `json:"message"`
}

type LeaseKubeEvents

type LeaseKubeEvents struct {
	Stream  <-chan cltypes.LeaseEvent
	OnClose <-chan string
}

type LeaseStatus

type LeaseStatus struct {
	Services       map[string]*cltypes.ServiceStatus        `json:"services"`
	ForwardedPorts map[string][]cltypes.ForwardedPortStatus `json:"forwarded_ports"` // Container services that are externally accessible
	IPs            map[string][]LeasedIPStatus              `json:"ips"`
}

type LeasedIPStatus

type LeasedIPStatus struct {
	Port         uint32
	ExternalPort uint32
	Protocol     string
	IP           string
}

type ServiceLogMessage

type ServiceLogMessage struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

type ServiceLogs

type ServiceLogs struct {
	Stream  <-chan ServiceLogMessage
	OnClose <-chan string
}

Jump to

Keyboard shortcuts

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