Documentation
¶
Index ¶
- Variables
- func ApproveJoinRequest(spaceId, identity string, permissions model.ParticipantPermissions) error
- func ClientContextWithAuth(token string) context.Context
- func ClientContextWithAuthTimeout(token string, timeout time.Duration) (context.Context, context.CancelFunc)
- func CloseEventReceiver()
- func CloseGRPCConnection()
- func CreateAPIKey(name string) (*pb.RpcAccountLocalLinkCreateAppResponse, error)
- func CreateWallet(name, rootPath, apiAddr string) (string, string, error)
- func DeleteStoredMnemonic() error
- func DeleteStoredToken() error
- func GRPCCall(fn func(ctx context.Context, client service.ClientCommandsClient) error) error
- func GRPCCallNoAuth(fn func(ctx context.Context, client service.ClientCommandsClient) error) error
- func GetGRPCClient() (service.ClientCommandsClient, error)
- func GetReleaseURL() string
- func GetStoredAccountId() (string, error)
- func GetStoredMnemonic() (string, error)
- func GetStoredTechSpaceId() (string, error)
- func GetStoredToken() (string, error)
- func GetVersion() string
- func GetVersionBrief() string
- func GetVersionVerbose() string
- func JoinSpace(networkId, spaceId, inviteCId, inviteFileKey string) error
- func LeaveSpace(spaceId string) error
- func ListAPIKeys() (*pb.RpcAccountLocalLinkListAppsResponse, error)
- func LoadStoredConfig() (*config.Config, error)
- func Login(mnemonic, rootPath, apiAddr string) error
- func LoginAccount(mnemonic, rootPath, apiAddr string) error
- func Logout() error
- func RevokeAPIKey(appId string) error
- func SaveMnemonic(mnemonic string) error
- func SaveToken(token string) error
- func ValidateMnemonic(mnemonic string) error
- func ViewSpaceInvite(inviteCId, inviteFileKey string) (*pb.RpcSpaceInviteViewResponse, error)
- func WaitForAccountId(er *EventReceiver) (string, error)
- func WaitForJoinRequestEvent(er *EventReceiver, spaceId string) (*model.NotificationRequestToJoin, error)
- type EventReceiver
- type SpaceListItem
Constants ¶
This section is empty.
Variables ¶
var ( Version = "" Commit = "" BuildTime = "" GitState = "" )
Set via ldflags during build
Functions ¶
func ApproveJoinRequest ¶
func ApproveJoinRequest(spaceId, identity string, permissions model.ParticipantPermissions) error
func ClientContextWithAuth ¶
func ClientContextWithAuthTimeout ¶
func ClientContextWithAuthTimeout(token string, timeout time.Duration) (context.Context, context.CancelFunc)
ClientContextWithAuthTimeout creates a context with both authentication and timeout
func CloseEventReceiver ¶
func CloseEventReceiver()
CloseEventReceiver closes the global event receiver instance if it exists
func CloseGRPCConnection ¶
func CloseGRPCConnection()
CloseGRPCConnection ensures the connection is properly closed
func CreateAPIKey ¶
func CreateAPIKey(name string) (*pb.RpcAccountLocalLinkCreateAppResponse, error)
CreateAPIKey creates a new API key for local app access
func CreateWallet ¶
CreateWallet creates a new wallet with the given root path and returns the mnemonic and account Id
func DeleteStoredMnemonic ¶
func DeleteStoredMnemonic() error
func DeleteStoredToken ¶
func DeleteStoredToken() error
func GRPCCall ¶
GRPCCall is a helper that reduces boilerplate for gRPC calls It gets the client, token, creates context with timeout, and executes the function
func GRPCCallNoAuth ¶
GRPCCallNoAuth is like GRPCCall but without authentication
func GetGRPCClient ¶
func GetGRPCClient() (service.ClientCommandsClient, error)
GetGRPCClient initializes (if needed) and returns the shared gRPC client
func GetReleaseURL ¶
func GetReleaseURL() string
func GetStoredAccountId ¶
GetStoredAccountId retrieves the stored account Id from config
func GetStoredMnemonic ¶
func GetStoredTechSpaceId ¶
GetStoredTechSpaceId retrieves the stored tech space Id from config
func GetStoredToken ¶
func GetVersion ¶
func GetVersion() string
func GetVersionBrief ¶
func GetVersionBrief() string
func GetVersionVerbose ¶
func GetVersionVerbose() string
func LeaveSpace ¶
func ListAPIKeys ¶
func ListAPIKeys() (*pb.RpcAccountLocalLinkListAppsResponse, error)
ListAPIKeys lists all API keys
func LoadStoredConfig ¶
LoadStoredConfig loads and returns the entire config
func LoginAccount ¶
LoginAccount performs the common steps for logging in with a given mnemonic and root path.
func SaveMnemonic ¶
func ValidateMnemonic ¶
func ViewSpaceInvite ¶
func ViewSpaceInvite(inviteCId, inviteFileKey string) (*pb.RpcSpaceInviteViewResponse, error)
func WaitForAccountId ¶
func WaitForAccountId(er *EventReceiver) (string, error)
WaitForAccountId waits for an accountShow event and returns the account Id
func WaitForJoinRequestEvent ¶
func WaitForJoinRequestEvent(er *EventReceiver, spaceId string) (*model.NotificationRequestToJoin, error)
WaitForJoinRequestEvent waits for a join request for the specified space
Types ¶
type EventReceiver ¶
type EventReceiver struct {
// contains filtered or unexported fields
}
func ListenForEvents ¶
func ListenForEvents(token string) (*EventReceiver, error)
ListenForEvents ensures a single EventReceiver instance is used.
func (*EventReceiver) WaitForEvent ¶
func (er *EventReceiver) WaitForEvent(ctx context.Context, predicate func(*pb.EventMessage) bool) (*pb.EventMessage, error)
WaitForEvent waits for an event matching the predicate
func (*EventReceiver) WaitOne ¶
func (er *EventReceiver) WaitOne(ctx context.Context) (*pb.EventMessage, error)
WaitOne waits for any single event with optional timeout
type SpaceListItem ¶
type SpaceListItem struct {
SpaceId string
Name string
Status model.SpaceStatus
}
func ListSpaces ¶
func ListSpaces() ([]SpaceListItem, error)
ListSpaces returns a list of all available spaces