Documentation
¶
Overview ¶
Package rpc loads the saved auth.json and constructs Connect clients that automatically attach the Bearer token. Every CLI command that talks to prosa-server goes through here.
Index ¶
- func Analytics(server, token string) prosav1connect.AnalyticsServiceClient
- func Auth(server string) prosav1connect.AuthServiceClient
- func ConnectError(err error) string
- func ContextOrBackground(ctx context.Context) context.Context
- func DeleteAuth() error
- func Devices(server, token string) prosav1connect.DevicesServiceClient
- func NormalizeServerURL(in string) string
- func SaveAuth(f AuthFile) error
- func Sessions(server, token string) prosav1connect.SessionsServiceClient
- type AuthFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Analytics ¶
func Analytics(server, token string) prosav1connect.AnalyticsServiceClient
func Auth ¶
func Auth(server string) prosav1connect.AuthServiceClient
Auth returns an AuthServiceClient (no auth file required; the auth RPCs are public).
func ConnectError ¶
ConnectError unwraps connect.Error for display.
func DeleteAuth ¶
func DeleteAuth() error
DeleteAuth removes auth.json. No-op when the file doesn't exist.
func Devices ¶
func Devices(server, token string) prosav1connect.DevicesServiceClient
func NormalizeServerURL ¶
NormalizeServerURL turns ":7070" into "http://localhost:7070" and strips trailing slashes.
func Sessions ¶
func Sessions(server, token string) prosav1connect.SessionsServiceClient
Sessions / Devices clients pull token from the loaded auth file. If the file is missing the caller gets an error so the command can suggest `prosa login`.
Types ¶
Click to show internal directories.
Click to hide internal directories.