Documentation
¶
Index ¶
- Constants
- func DecryptSecrets(encryptedBytes *[]byte, xkey nkeys.KeyPair, sender string) (map[string]SecretValue, error)
- type HealthCheckResponse
- type HostData
- type InterfaceLinkDefinition
- type Level
- type OtelConfig
- func (config *OtelConfig) LogsEnabled() bool
- func (config *OtelConfig) LogsURL() string
- func (config *OtelConfig) MetricsEnabled() bool
- func (config *OtelConfig) MetricsURL() string
- func (config *OtelConfig) OtelProtocol() string
- func (config *OtelConfig) TracesEnabled() bool
- func (config *OtelConfig) TracesURL() string
- type ProviderHandler
- func HealthCheck(inFunc func() string) ProviderHandler
- func Shutdown(inFunc func() error) ProviderHandler
- func SourceLinkDel(inFunc func(InterfaceLinkDefinition) error) ProviderHandler
- func SourceLinkPut(inFunc func(InterfaceLinkDefinition) error) ProviderHandler
- func TargetLinkDel(inFunc func(InterfaceLinkDefinition) error) ProviderHandler
- func TargetLinkPut(inFunc func(InterfaceLinkDefinition) error) ProviderHandler
- type RedactedString
- type SecretBytesValue
- type SecretStringValue
- type SecretValue
- type Topics
- type WasmcloudProvider
- func (wp *WasmcloudProvider) DecryptLinkSecrets(h linkWithEncryptedSecrets) (InterfaceLinkDefinition, error)
- func (wp *WasmcloudProvider) HostData() HostData
- func (wp *WasmcloudProvider) NatsConnection() *nats.Conn
- func (wp *WasmcloudProvider) OutgoingRpcClient(target string) *wrpcnats.Client
- func (wp *WasmcloudProvider) Shutdown() error
- func (wp *WasmcloudProvider) Start() error
Constants ¶
const ( // https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_endpoint OtelExporterGrpcEndpoint = "http://localhost:4317" OtelExporterHTTPEndpoint = "http://localhost:4318" // https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_traces_endpoint OtelExporterHTTPTracesPath = "/v1/traces" // https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_metrics_endpoint OtelExporterHTTPMetricsPath = "/v1/metrics" // https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/#otel_exporter_otlp_logs_endpoint OtelExporterHTTPLogsPath = "/v1/logs" )
Variables ¶
This section is empty.
Functions ¶
func DecryptSecrets ¶
Types ¶
type HealthCheckResponse ¶
type HostData ¶
type HostData struct {
HostID string `json:"host_id,omitempty"`
LatticeRPCPrefix string `json:"lattice_rpc_prefix,omitempty"`
LatticeRPCUserJWT string `json:"lattice_rpc_user_jwt,omitempty"`
LatticeRPCUserSeed string `json:"lattice_rpc_user_seed,omitempty"`
LatticeRPCURL string `json:"lattice_rpc_url,omitempty"`
ProviderKey string `json:"provider_key,omitempty"`
EnvValues map[string]string `json:"env_values,omitempty"`
InstanceID string `json:"instance_id,omitempty"`
LinkDefinitions []linkWithEncryptedSecrets `json:"link_definitions,omitempty"`
ClusterIssuers []string `json:"cluster_issuers,omitempty"`
Config map[string]string `json:"config,omitempty"`
Secrets map[string]SecretValue `json:"secrets,omitempty"`
HostXKeyPublicKey string `json:"host_xkey_public_key,omitempty"`
ProviderXKeyPrivateKey RedactedString `json:"provider_xkey_private_key,omitempty"`
DefaultRPCTimeoutMS *uint64 `json:"default_rpc_timeout_ms,omitempty"`
StructuredLogging bool `json:"structured_logging,omitempty"`
LogLevel *Level `json:"log_level,omitempty"`
OtelConfig OtelConfig `json:"otel_config,omitempty"`
}
type InterfaceLinkDefinition ¶
type InterfaceLinkDefinition struct {
SourceID string `json:"source_id,omitempty"`
Target string `json:"target,omitempty"`
Name string `json:"name,omitempty"`
WitNamespace string `json:"wit_namespace,omitempty"`
WitPackage string `json:"wit_package,omitempty"`
Interfaces []string `json:"interfaces,omitempty"`
SourceConfig map[string]string `json:"source_config,omitempty"`
TargetConfig map[string]string `json:"target_config,omitempty"`
SourceSecrets map[string]SecretValue `json:"source_secrets,omitempty"`
TargetSecrets map[string]SecretValue `json:"target_secrets,omitempty"`
}
type OtelConfig ¶
type OtelConfig struct {
EnableObservability bool `json:"enable_observability"`
EnableTraces bool `json:"enable_traces,omitempty"`
EnableMetrics bool `json:"enable_metrics,omitempty"`
EnableLogs bool `json:"enable_logs,omitempty"`
ObservabilityEndpoint string `json:"observability_endpoint,omitempty"`
TracesEndpoint string `json:"traces_endpoint,omitempty"`
MetricsEndpoint string `json:"metrics_endpoint,omitempty"`
LogsEndpoint string `json:"logs_endpoint,omitempty"`
Protocol string `json:"protocol,omitempty"`
}
func (*OtelConfig) LogsEnabled ¶ added in v0.0.4
func (config *OtelConfig) LogsEnabled() bool
LogsEnabled returns whether emitting logs has been enabled.
func (*OtelConfig) LogsURL ¶ added in v0.0.4
func (config *OtelConfig) LogsURL() string
LogsURL returns the configured LogsEndpoint as-is if one is provided, otherwise it resolves the URL based on ObservabilityEndpoint value and the Protocol appropriate path.
func (*OtelConfig) MetricsEnabled ¶ added in v0.0.4
func (config *OtelConfig) MetricsEnabled() bool
MetricsEnabled returns whether emitting metrics has been enabled.
func (*OtelConfig) MetricsURL ¶ added in v0.0.4
func (config *OtelConfig) MetricsURL() string
MetricsURL returns the configured MetricsEndpoint as-is if one is provided, otherwise it resolves the URL based on ObservabilityEndpoint value and the Protocol appropriate path.
func (*OtelConfig) OtelProtocol ¶ added in v0.0.4
func (config *OtelConfig) OtelProtocol() string
OtelProtocol returns the configured OpenTelemetry protocol if one is provided, otherwise defaulting to http.
func (*OtelConfig) TracesEnabled ¶ added in v0.0.4
func (config *OtelConfig) TracesEnabled() bool
TracesEnabled returns whether emitting traces has been enabled.
func (*OtelConfig) TracesURL ¶ added in v0.0.4
func (config *OtelConfig) TracesURL() string
TracesURL returns the configured TracesEndpoint as-is if one is provided, otherwise it resolves the URL based on ObservabilityEndpoint value and the Protocol appropriate path.
type ProviderHandler ¶
type ProviderHandler func(*WasmcloudProvider) error
func HealthCheck ¶
func HealthCheck(inFunc func() string) ProviderHandler
func Shutdown ¶
func Shutdown(inFunc func() error) ProviderHandler
func SourceLinkDel ¶
func SourceLinkDel(inFunc func(InterfaceLinkDefinition) error) ProviderHandler
func SourceLinkPut ¶
func SourceLinkPut(inFunc func(InterfaceLinkDefinition) error) ProviderHandler
func TargetLinkDel ¶
func TargetLinkDel(inFunc func(InterfaceLinkDefinition) error) ProviderHandler
func TargetLinkPut ¶
func TargetLinkPut(inFunc func(InterfaceLinkDefinition) error) ProviderHandler
type RedactedString ¶ added in v0.0.3
type RedactedString string
func (RedactedString) MarshalJSON ¶ added in v0.0.3
func (rs RedactedString) MarshalJSON() ([]byte, error)
func (RedactedString) Reveal ¶ added in v0.0.3
func (rs RedactedString) Reveal() string
func (RedactedString) String ¶ added in v0.0.3
func (rs RedactedString) String() string
type SecretBytesValue ¶
type SecretBytesValue struct {
// contains filtered or unexported fields
}
func (SecretBytesValue) Reveal ¶
func (s SecretBytesValue) Reveal() []byte
func (SecretBytesValue) String ¶
func (s SecretBytesValue) String() string
type SecretStringValue ¶
type SecretStringValue struct {
// contains filtered or unexported fields
}
func (SecretStringValue) Reveal ¶
func (s SecretStringValue) Reveal() string
func (SecretStringValue) String ¶
func (s SecretStringValue) String() string
func (*SecretStringValue) UnmarshalJSON ¶
func (s *SecretStringValue) UnmarshalJSON(data []byte) error
type SecretValue ¶
type SecretValue struct {
String SecretStringValue
Bytes SecretBytesValue
}
func (*SecretValue) UnmarshalJSON ¶
func (s *SecretValue) UnmarshalJSON(data []byte) error
Secret values are serialized as either a String or Bytes value, e.g. {"kind": "String", "value": "my secret"} or {"kind": "Bytes", "value": [1, 2, 3]}
type Topics ¶
type WasmcloudProvider ¶
type WasmcloudProvider struct {
ID string
Logger *slog.Logger
Topics Topics
RPCClient *wrpcnats.Client
// contains filtered or unexported fields
}
func New ¶
func New(options ...ProviderHandler) (*WasmcloudProvider, error)
func NewWithHostDataSource ¶ added in v0.0.3
func NewWithHostDataSource(source io.Reader, options ...ProviderHandler) (*WasmcloudProvider, error)
func (*WasmcloudProvider) DecryptLinkSecrets ¶
func (wp *WasmcloudProvider) DecryptLinkSecrets(h linkWithEncryptedSecrets) (InterfaceLinkDefinition, error)
func (*WasmcloudProvider) HostData ¶
func (wp *WasmcloudProvider) HostData() HostData
func (*WasmcloudProvider) NatsConnection ¶
func (wp *WasmcloudProvider) NatsConnection() *nats.Conn
func (*WasmcloudProvider) OutgoingRpcClient ¶
func (wp *WasmcloudProvider) OutgoingRpcClient(target string) *wrpcnats.Client
func (*WasmcloudProvider) Shutdown ¶
func (wp *WasmcloudProvider) Shutdown() error
func (*WasmcloudProvider) Start ¶
func (wp *WasmcloudProvider) Start() error
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Generated by `wit-bindgen-wrpc-go` 0.9.1.
|
Generated by `wit-bindgen-wrpc-go` 0.9.1. |
|
wasi/clocks/monotonic_clock
Generated by `wit-bindgen-wrpc-go` 0.9.1.
|
Generated by `wit-bindgen-wrpc-go` 0.9.1. |
|
wasi/http/types
Generated by `wit-bindgen-wrpc-go` 0.9.1.
|
Generated by `wit-bindgen-wrpc-go` 0.9.1. |
|
wasi/io/error
Generated by `wit-bindgen-wrpc-go` 0.9.1.
|
Generated by `wit-bindgen-wrpc-go` 0.9.1. |
|
wasi/io/poll
Generated by `wit-bindgen-wrpc-go` 0.9.1.
|
Generated by `wit-bindgen-wrpc-go` 0.9.1. |
|
wasi/io/streams
Generated by `wit-bindgen-wrpc-go` 0.9.1.
|
Generated by `wit-bindgen-wrpc-go` 0.9.1. |
|
wrpc/http/incoming_handler
Generated by `wit-bindgen-wrpc-go` 0.9.1.
|
Generated by `wit-bindgen-wrpc-go` 0.9.1. |
|
wrpc/http/types
Generated by `wit-bindgen-wrpc-go` 0.9.1.
|
Generated by `wit-bindgen-wrpc-go` 0.9.1. |