hermesbridge

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWebhookRouteName = defaultWebhookRouteName

Variables

This section is empty.

Functions

func DeliverDisplayName

func DeliverDisplayName(deliver string) string

func HomeChannelEnvKey

func HomeChannelEnvKey(deliver string) string

func IsSupportedDeliverTarget

func IsSupportedDeliverTarget(value string) bool

func NormalizeDeliverTarget

func NormalizeDeliverTarget(value string) string

func ResolveHermesHome

func ResolveHermesHome() (string, error)

func RunService

func RunService(resolved *appconfig.Resolved) error

func SupportedDeliverTargets

func SupportedDeliverTargets() []string

func ValidateLocalNotifyURL

func ValidateLocalNotifyURL(rawURL string) (*url.URL, string, int, error)

Types

type BridgeConfig

type BridgeConfig struct {
	NotifyURL          string     `json:"notify_url"`
	HealthURL          string     `json:"health_url"`
	AdapterHost        string     `json:"adapter_host"`
	AdapterPort        int        `json:"adapter_port"`
	NotifySecret       string     `json:"-"`
	NotifySecretSource string     `json:"notify_secret_source"`
	HermesHome         string     `json:"hermes_home"`
	HermesConfigFile   string     `json:"hermes_config_file"`
	HermesWebhookURL   string     `json:"hermes_webhook_url"`
	RouteName          string     `json:"route_name"`
	RouteSecret        string     `json:"-"`
	RouteState         RouteState `json:"route_state"`
	AdapterScript      string     `json:"adapter_script"`
	PythonExecutable   string     `json:"python_executable"`
}

func ResolveBridgeConfig

func ResolveBridgeConfig(resolved *appconfig.Resolved) (*BridgeConfig, error)

type EnsureRouteOptions

type EnsureRouteOptions struct {
	HermesHome  string
	RouteName   string
	Deliver     string
	WebhookPort int
	Prompt      string
}

type RouteState

type RouteState struct {
	HermesHome                  string   `json:"hermes_home"`
	ConfigFile                  string   `json:"config_file"`
	EnvFile                     string   `json:"env_file"`
	ConfigExists                bool     `json:"config_exists"`
	WebhookEnabled              bool     `json:"webhook_enabled"`
	WebhookPort                 int      `json:"webhook_port"`
	RouteName                   string   `json:"route_name"`
	RouteConfigured             bool     `json:"route_configured"`
	RouteSecret                 string   `json:"-"`
	RouteSecretConfigured       bool     `json:"route_secret_configured"`
	Deliver                     string   `json:"deliver"`
	DeliverUsesHomeChannel      bool     `json:"deliver_uses_home_channel"`
	HomeChannelKey              string   `json:"home_channel_key,omitempty"`
	HomeChannel                 string   `json:"home_channel,omitempty"`
	HomeChannelConfigured       bool     `json:"home_channel_configured"`
	HomeChannelSupported        bool     `json:"home_channel_supported"`
	FeishuCredentialsConfigured bool     `json:"feishu_credentials_configured"`
	NotifyWebhookURL            string   `json:"notify_webhook_url"`
	Warnings                    []string `json:"warnings,omitempty"`
}

func EnsureRoute

func EnsureRoute(options EnsureRouteOptions) (RouteState, error)

func InspectRoute

func InspectRoute(home string, routeName string) (RouteState, error)

type Status

type Status struct {
	ServiceName     string        `json:"service_name"`
	ServicePlatform string        `json:"service_platform,omitempty"`
	Installed       bool          `json:"installed"`
	Running         bool          `json:"running"`
	BridgeAvailable bool          `json:"bridge_available"`
	HealthURL       string        `json:"health_url,omitempty"`
	Config          *BridgeConfig `json:"config,omitempty"`
	Warnings        []string      `json:"warnings,omitempty"`
}

func Apply

func Apply(resolved *appconfig.Resolved) (Status, error)

func EnsureInstalled

func EnsureInstalled(resolved *appconfig.Resolved) (Status, error)

func RestartService

func RestartService(resolved *appconfig.Resolved) (Status, error)

func StartService

func StartService(resolved *appconfig.Resolved) (Status, error)

func StatusFor

func StatusFor(resolved *appconfig.Resolved) (Status, error)

func StopService

func StopService(resolved *appconfig.Resolved) (Status, error)

func Uninstall

func Uninstall(resolved *appconfig.Resolved) (Status, error)

Jump to

Keyboard shortcuts

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