transport

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIdentityProxyAvailable

func CheckIdentityProxyAvailable(endpoint string) (bool, error)

CheckIdentityProxyAvailable checks if the given gRPC endpoint can be used as an identity proxy by verifying the presence of both Endpoint and Token services. These services are required for the identity service to act as a proxy.

Parameters:

  • endpoint: The gRPC endpoint URL to check

Returns:

  • bool: true if both Endpoint and Token services are present
  • error: An error if the operation fails

func FetchService

func FetchService(serviceName string, verb string, resourceName string, options *FetchOptions) (map[string]interface{}, error)

FetchService handles the execution of gRPC commands for all services

func FormatTableValue

func FormatTableValue(val interface{}) string

func GetGrpcConnection added in v1.0.14

func GetGrpcConnection(endpoint string) (*grpc.ClientConn, error)

GetGrpcConnection establishes a gRPC connection with the specified endpoint

func ListGRPCServices

func ListGRPCServices(endpoint string) ([]string, error)

ListGRPCServices retrieves a list of available gRPC services from the specified endpoint. It supports only grpc+ssl:// scheme, with proper TLS configuration for secure connections. The function uses gRPC reflection to discover available services.

Parameters:

  • endpoint: The gRPC endpoint URL (e.g., "grpc+ssl://api.example.com:443")

Returns:

  • []string: A list of available service names
  • error: An error if the operation fails

Example:

services, err := GetGRPCServices("grpc+ssl://api.example.com:443")
if err != nil {
    log.Fatalf("Failed to get services: %v", err)
}

func WatchResource

func WatchResource(serviceName, verb, resource string, options *FetchOptions) error

WatchResource monitors a resource for changes and prints updates

Types

type Config

type Config struct {
	Environment  string                 `yaml:"environment"`
	Environments map[string]Environment `yaml:"environments"`
}

type Environment

type Environment struct {
	Endpoint string `yaml:"endpoint"`
	Proxy    string `yaml:"proxy"`
	Token    string `yaml:"token"`
}

type FetchOptions

type FetchOptions struct {
	Parameters           []string
	JSONParameter        string
	FileParameter        string
	APIVersion           string
	OutputFormat         string
	OutputFormatExplicit bool
	CopyToClipboard      bool
	SortBy               string
	MinimalColumns       bool
	Columns              string
	Rows                 int
	Page                 int
	PageSize             int
	NoPaging             bool
}

FetchOptions holds the flag values for a command

Jump to

Keyboard shortcuts

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