ui

package
v0.0.0-...-426bf0d Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package ui implements the GRPC UI service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	SetUserSubscription(ctx context.Context, token string) error
	SetStoreSubscription(ctx context.Context, token string) error
	Subscription() (string, config.Source, error)
	SetUserLandscapeConfig(ctx context.Context, token string) error
	LandscapeClientConfig() (string, config.Source, error)
}

Config is a provider for the subscription configuration.

type Service

type Service struct {
	agentapi.UnimplementedUIServer
	// contains filtered or unexported fields
}

Service it the UI GRPC service implementation.

func New

func New(ctx context.Context, config Config, db *database.DistroDB, args ...contracts.Option) (s Service)

New returns a new service handling the UI API.

func (*Service) ApplyLandscapeConfig

func (s *Service) ApplyLandscapeConfig(ctx context.Context, landscapeConfig *agentapi.LandscapeConfig) (*agentapi.LandscapeSource, error)

ApplyLandscapeConfig handles the gRPC call to set landscape configuration.

func (*Service) ApplyProToken

func (s *Service) ApplyProToken(ctx context.Context, info *agentapi.ProAttachInfo) (_ *agentapi.SubscriptionInfo, err error)

ApplyProToken handles the gRPC call to pro attach all distros using a token provided by the GUI.

func (*Service) GetConfigSources

func (s *Service) GetConfigSources(ctx context.Context, empty *agentapi.Empty) (*agentapi.ConfigSources, error)

GetConfigSources handles the gRPC call to return the type of subscription and Landscape config sources.

func (*Service) NotifyPurchase

func (s *Service) NotifyPurchase(ctx context.Context, empty *agentapi.Empty) (info *agentapi.SubscriptionInfo, errs error)

NotifyPurchase handles the client notification of a successful purchase through MS Store.

func (*Service) Ping

func (s *Service) Ping(ctx context.Context, request *agentapi.Empty) (*agentapi.Empty, error)

Ping replies a keep-alive request.

Jump to

Keyboard shortcuts

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