Documentation
¶
Index ¶
- func CheckIdentityProxyAvailable(endpoint string) (bool, error)
- func FetchService(serviceName string, verb string, resourceName string, options *FetchOptions) (map[string]interface{}, error)
- func FormatTableValue(val interface{}) string
- func GetGrpcConnection(endpoint string) (*grpc.ClientConn, error)
- func ListGRPCServices(endpoint string) ([]string, error)
- func WatchResource(serviceName, verb, resource string, options *FetchOptions) error
- type Config
- type Environment
- type FetchOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIdentityProxyAvailable ¶
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 ¶
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 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