api

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API handles the application's business logic

func New

func New() (*API, error)

New creates a new API instance

func (*API) AddProfile

func (a *API) AddProfile(profile database.Profile) (int64, error)

AddProfile adds a new profile

func (*API) ClearLogs

func (a *API) ClearLogs() error

ClearLogs clears all logs

func (*API) Close

func (a *API) Close() error

Close closes the API and releases resources

func (*API) DeleteProfile

func (a *API) DeleteProfile(id int64) error

DeleteProfile deletes a profile

func (*API) GetActivityLogs

func (a *API) GetActivityLogs() ([]database.ActivityLog, error)

GetActivityLogs returns all activity logs

func (*API) GetGostDebugInfo

func (a *API) GetGostDebugInfo() map[string]interface{}

GetGostDebugInfo returns debug information about GOST detection

func (*API) GetGostVersion

func (a *API) GetGostVersion() string

GetGostVersion returns the GOST version if available

func (*API) GetLogs

func (a *API) GetLogs() ([]LogEntry, error)

GetLogs returns all logs

func (*API) GetProfile

func (a *API) GetProfile(id int64) (*database.Profile, error)

GetProfile returns a profile by ID

func (*API) GetProfiles

func (a *API) GetProfiles() ([]database.Profile, error)

GetProfiles returns all profiles

func (*API) GetRecentActivityLogs

func (a *API) GetRecentActivityLogs(limit int) ([]database.ActivityLog, error)

GetRecentActivityLogs returns the most recent activity logs

func (*API) GetRecentLogs

func (a *API) GetRecentLogs(limit int) ([]LogEntry, error)

GetRecentLogs returns the most recent logs

func (*API) IsGostAvailable

func (a *API) IsGostAvailable() bool

IsGostAvailable returns whether GOST is available

func (*API) StartProfile

func (a *API) StartProfile(id int64) error

StartProfile starts a profile

func (*API) StopProfile

func (a *API) StopProfile(id int64) error

StopProfile stops a profile

func (*API) UpdateProfile

func (a *API) UpdateProfile(profile database.Profile) error

UpdateProfile updates an existing profile

type GostConfig

type GostConfig struct {
	Services []struct {
		Name    string `json:"name"`
		Addr    string `json:"addr"`
		Handler struct {
			Type string `json:"type"`
			Auth struct {
				Username string `json:"username,omitempty"`
				Password string `json:"password,omitempty"`
			} `json:"auth,omitempty"`
		} `json:"handler"`
		Forwarder struct {
			Nodes []struct {
				Addr string `json:"addr"`
			} `json:"nodes"`
		} `json:"forwarder"`
	} `json:"services"`
}

GostConfig represents the GOST configuration

type LogEntry

type LogEntry struct {
	ID          int64  `json:"id"`
	Timestamp   string `json:"timestamp"` // ISO 8601 format string for Wails compatibility
	Level       string `json:"level"`     // "INFO", "WARN", "ERROR", "DEBUG"
	Source      string `json:"source"`    // "gost", "system", "api"
	Message     string `json:"message"`
	ProfileID   *int64 `json:"profile_id,omitempty"`
	ProfileName string `json:"profile_name,omitempty"`
}

LogEntry represents a log entry from GOST or system

Jump to

Keyboard shortcuts

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