platform

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package platform provides third-party platform integration support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalRequest

func MarshalRequest(v interface{}) ([]byte, error)

MarshalRequest converts a struct to JSON bytes for the request.

func UnmarshalResponse

func UnmarshalResponse(data []byte, v interface{}) error

UnmarshalResponse parses JSON response bytes into a struct.

Types

type Config

type Config struct {
	Platforms map[string]ProviderEntry `yaml:"platforms"`
}

Config represents the platforms configuration file structure.

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

Loader loads and manages platform providers from configuration.

func NewLoader

func NewLoader(configPath string, logger *slog.Logger) *Loader

NewLoader creates a new platform loader.

func (*Loader) Close

func (l *Loader) Close() error

Close closes all providers.

func (*Loader) GetProvider

func (l *Loader) GetProvider(name string) (provider.Provider, bool)

GetProvider returns a provider by name.

func (*Loader) ListProviders

func (l *Loader) ListProviders() []provider.Provider

ListProviders returns all loaded providers.

func (*Loader) Load

func (l *Loader) Load(ctx context.Context) error

Load loads providers from the configuration file.

func (*Loader) Registry

func (l *Loader) Registry() *provider.Registry

Registry returns the provider registry.

func (*Loader) Reload

func (l *Loader) Reload(ctx context.Context) error

Reload reloads the configuration.

type ProviderEntry

type ProviderEntry struct {
	Enabled bool                   `yaml:"enabled"`
	Type    string                 `yaml:"type"`
	Config  map[string]interface{} `yaml:"config"`
}

ProviderEntry represents a single provider entry in the config.

type Server

type Server struct {
	platformv1.UnimplementedPlatformServiceServer
	// contains filtered or unexported fields
}

Server implements the PlatformService gRPC server.

func NewServer

func NewServer(loader *Loader, logger *slog.Logger) *Server

NewServer creates a new PlatformService server.

func (*Server) CallPlatform

CallPlatform invokes a method on a third-party platform.

func (*Server) ListPlatformMethods

ListPlatformMethods returns the methods supported by a platform.

func (*Server) ListPlatforms

ListPlatforms returns all available platforms.

func (*Server) ReloadPlatformConfig

func (s *Server) ReloadPlatformConfig(ctx context.Context, req *emptypb.Empty) (*platformv1.ReloadPlatformConfigResponse, error)

ReloadPlatformConfig reloads the platform configuration.

Directories

Path Synopsis
monitoring
Package openapi provides a generic provider for OpenAPI/Swagger based services.
Package openapi provides a generic provider for OpenAPI/Swagger based services.
Package provider provides a pluggable interface for third-party platform integrations.
Package provider provides a pluggable interface for third-party platform integrations.
Package quicksdk provides a client for the QuickSDK open API.
Package quicksdk provides a client for the QuickSDK open API.
Package ratelimit provides rate limiting utilities for platform providers.
Package ratelimit provides rate limiting utilities for platform providers.

Jump to

Keyboard shortcuts

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