Documentation
¶
Overview ¶
Package cmd provides CLI commands for OSAPI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NATSClient ¶
type NATSClient interface {
// Connection management
Connect() error
Close()
// Stream operations
CreateOrUpdateStreamWithConfig(
ctx context.Context,
streamConfig jetstream.StreamConfig,
) error
GetStreamInfo(
ctx context.Context,
streamName string,
) (*jetstream.StreamInfo, error)
// KV operations
CreateOrUpdateKVBucket(
ctx context.Context,
bucketName string,
) (jetstream.KeyValue, error)
CreateOrUpdateKVBucketWithConfig(
ctx context.Context,
config jetstream.KeyValueConfig,
) (jetstream.KeyValue, error)
// Object Store operations
CreateOrUpdateObjectStore(
ctx context.Context,
cfg jetstream.ObjectStoreConfig,
) (jetstream.ObjectStore, error)
ObjectStore(
ctx context.Context,
name string,
) (jetstream.ObjectStore, error)
// Message publishing
Publish(
ctx context.Context,
subject string,
data []byte,
) error
// Message consumption
ConsumeMessages(
ctx context.Context,
streamName string,
consumerName string,
handler natsclient.JetStreamMessageHandler,
opts *natsclient.ConsumeOptions,
) error
CreateOrUpdateConsumerWithConfig(
ctx context.Context,
streamName string,
consumerConfig jetstream.ConsumerConfig,
) error
// KV convenience operations
KVPut(
bucket string,
key string,
value []byte,
) error
// Core NATS operations (non-JetStream)
Subscribe(
subject string,
handler nats.MsgHandler,
) (*nats.Subscription, error)
PublishCore(
subject string,
data []byte,
) error
// Connection inspection
ConnectedURL() string
ConnectedServerVersion() string
// JetStream handle access
KeyValue(
ctx context.Context,
bucket string,
) (jetstream.KeyValue, error)
Stream(
ctx context.Context,
name string,
) (jetstream.Stream, error)
}
NATSClient defines the NATS operations needed by cmd setup, runtime, and metrics functions. Each function that receives a NATSClient uses only a subset of these methods; the full interface is defined here so the natsBundle can store a single value that satisfies all consumers.
type ServerManager ¶
type ServerManager interface {
cli.Lifecycle
// RegisterHandlers registers a list of handlers with the Echo instance.
RegisterHandlers(handlers []func(e *echo.Echo))
}
ServerManager responsible for Server operations.
type TokenGenerator ¶
type TokenGenerator interface {
Generate(
signingKey string,
roles []string,
subject string,
permissions []string,
) (string, error)
}
TokenGenerator generates signed JWT tokens.
type TokenValidator ¶
type TokenValidator interface {
Validate(
tokenString string,
signingKey string,
) (*authtoken.CustomClaims, error)
}
TokenValidator parses and validates JWT tokens.
Source Files
¶
- agent.go
- agent_setup.go
- agent_start.go
- client.go
- client_agent.go
- client_agent_accept.go
- client_agent_drain.go
- client_agent_get.go
- client_agent_key.go
- client_agent_list.go
- client_agent_reject.go
- client_agent_status.go
- client_agent_undrain.go
- client_audit.go
- client_audit_export.go
- client_audit_get.go
- client_audit_list.go
- client_controller.go
- client_controller_key.go
- client_controller_status.go
- client_file.go
- client_file_delete.go
- client_file_get.go
- client_file_list.go
- client_file_stale.go
- client_file_upload.go
- client_health.go
- client_health_liveness.go
- client_health_ready.go
- client_health_status.go
- client_job.go
- client_job_delete.go
- client_job_get.go
- client_job_list.go
- client_job_retry.go
- client_nats.go
- client_nats_status.go
- client_node.go
- client_node_certificate.go
- client_node_certificate_create.go
- client_node_certificate_delete.go
- client_node_certificate_list.go
- client_node_certificate_update.go
- client_node_command.go
- client_node_command_exec.go
- client_node_command_shell.go
- client_node_container.go
- client_node_container_docker.go
- client_node_container_docker_create.go
- client_node_container_docker_exec.go
- client_node_container_docker_image_remove.go
- client_node_container_docker_inspect.go
- client_node_container_docker_list.go
- client_node_container_docker_pull.go
- client_node_container_docker_remove.go
- client_node_container_docker_start.go
- client_node_container_docker_stop.go
- client_node_disk.go
- client_node_disk_get.go
- client_node_file.go
- client_node_file_deploy.go
- client_node_file_status.go
- client_node_file_undeploy.go
- client_node_group.go
- client_node_group_create.go
- client_node_group_delete.go
- client_node_group_get.go
- client_node_group_list.go
- client_node_group_update.go
- client_node_hostname.go
- client_node_hostname_get.go
- client_node_hostname_update.go
- client_node_load.go
- client_node_load_get.go
- client_node_log.go
- client_node_log_query.go
- client_node_log_source.go
- client_node_log_unit.go
- client_node_memory.go
- client_node_memory_get.go
- client_node_network.go
- client_node_network_dns.go
- client_node_network_dns_delete.go
- client_node_network_dns_get.go
- client_node_network_dns_update.go
- client_node_network_interface.go
- client_node_network_interface_create.go
- client_node_network_interface_delete.go
- client_node_network_interface_get.go
- client_node_network_interface_list.go
- client_node_network_interface_update.go
- client_node_network_ping.go
- client_node_network_route.go
- client_node_network_route_create.go
- client_node_network_route_delete.go
- client_node_network_route_get.go
- client_node_network_route_list.go
- client_node_network_route_update.go
- client_node_ntp.go
- client_node_ntp_create.go
- client_node_ntp_delete.go
- client_node_ntp_get.go
- client_node_ntp_update.go
- client_node_os.go
- client_node_os_get.go
- client_node_package.go
- client_node_package_get.go
- client_node_package_install.go
- client_node_package_list.go
- client_node_package_remove.go
- client_node_package_update.go
- client_node_package_updates.go
- client_node_power.go
- client_node_power_reboot.go
- client_node_power_shutdown.go
- client_node_process.go
- client_node_process_get.go
- client_node_process_list.go
- client_node_process_signal.go
- client_node_schedule.go
- client_node_schedule_create.go
- client_node_schedule_delete.go
- client_node_schedule_get.go
- client_node_schedule_list.go
- client_node_schedule_update.go
- client_node_service.go
- client_node_service_create.go
- client_node_service_delete.go
- client_node_service_disable.go
- client_node_service_enable.go
- client_node_service_get.go
- client_node_service_list.go
- client_node_service_restart.go
- client_node_service_start.go
- client_node_service_stop.go
- client_node_service_update.go
- client_node_status_get.go
- client_node_sysctl.go
- client_node_sysctl_create.go
- client_node_sysctl_delete.go
- client_node_sysctl_get.go
- client_node_sysctl_list.go
- client_node_sysctl_update.go
- client_node_timezone.go
- client_node_timezone_get.go
- client_node_timezone_update.go
- client_node_uptime.go
- client_node_uptime_get.go
- client_node_user.go
- client_node_user_create.go
- client_node_user_delete.go
- client_node_user_get.go
- client_node_user_list.go
- client_node_user_password.go
- client_node_user_ssh_key.go
- client_node_user_ssh_key_add.go
- client_node_user_ssh_key_list.go
- client_node_user_ssh_key_remove.go
- client_node_user_update.go
- controller.go
- controller_setup.go
- controller_start.go
- job.go
- nats.go
- nats_heartbeat.go
- nats_server.go
- nats_server_start.go
- nats_setup.go
- root.go
- start.go
- token.go
- token_generate.go
- token_validate.go
- version.go
Click to show internal directories.
Click to hide internal directories.