sharedtypes

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddGroupData

type AddGroupData struct {
	Name            string `json:"name"`
	SubscriptionUrl string `json:"subscription_url"`
}

type AddGroupEnter

type AddGroupEnter struct{}

type AddGroupExit

type AddGroupExit struct{}

type AddProfilesData

type AddProfilesData struct {
	Uris    string `json:"uris"`
	GroupId int    `json:"group_id"`
}

type ApplicationState

type ApplicationState struct {
	Groups           []GroupWithProfiles `json:"groups"`
	ConnectionStatus ProxyStatus         `json:"connection-status"`
	TunStatus        bool                `json:"tun-status"`
}

func (ApplicationState) IsNotification

func (a ApplicationState) IsNotification()

type ClearWarnings

type ClearWarnings struct{}

type ConnectData

type ConnectData struct {
	Profile ProfileID `json:"profile"`
}

type DeleteGroupData

type DeleteGroupData struct {
	Id int `json:"id"`
}

type DeleteProfilesData

type DeleteProfilesData struct {
	Profiles []ProfileID `json:"profiles"`
}

type DieData

type DieData struct{}

type DisableTunData

type DisableTunData struct{}

type DisconnectData

type DisconnectData struct{}

type EnableTunData

type EnableTunData struct{}

type GetApplicationStateData

type GetApplicationStateData struct{}

type Group

type Group struct {
	Id              int    `json:"id"`
	SubscriptionUrl string `json:"subscription_url"`
	Name            string `json:"name"`
	LastId          int    `json:"last_id"`
}

type GroupAdded

type GroupAdded struct {
	Id              int    `json:"id"`
	SubscriptionUrl string `json:"subscription_url"`
	Name            string `json:"name"`
}

func (GroupAdded) IsNotification

func (g GroupAdded) IsNotification()

type GroupDeleted

type GroupDeleted struct {
	Id int `json:"id"`
}

func (GroupDeleted) IsNotification

func (g GroupDeleted) IsNotification()

type GroupWithProfiles

type GroupWithProfiles struct {
	Group    Group     `json:"group"`
	Profiles []Profile `json:"profiles"`
}

type HelpViewEnter

type HelpViewEnter struct{}

type HelpViewExit

type HelpViewExit struct{}

type IsRootAnswer

type IsRootAnswer struct {
	IsRoot bool
}

func (IsRootAnswer) IsNotification

func (i IsRootAnswer) IsNotification()

type IsRootData

type IsRootData struct{}

type KillCore

type KillCore struct{}

type Message

type Message[T any] struct {
	Msg  string `json:"msg"`
	Data T      `json:"data"`
}

type Profile

type Profile struct {
	Id         int    `json:"id"`
	GroupId    int    `json:"group_id"`
	Name       string `json:"name"`
	Protocol   string `json:"protocol"`
	Uri        string `json:"uri"`
	Address    string `json:"address,omitzero"`
	Host       string `json:"host,omitzero"`
	TestResult int    `json:"test-result"`
}

type ProfileID

type ProfileID struct {
	Id      int `json:"id"`
	GroupId int `json:"group_id"`
}

type ProfileUpdated

type ProfileUpdated struct {
	Profile Profile `json:"profile"`
}

func (ProfileUpdated) IsNotification

func (p ProfileUpdated) IsNotification()

type ProfilesAdded

type ProfilesAdded struct {
	Profiles []Profile `json:"profiles"`
}

func (ProfilesAdded) IsNotification

func (p ProfilesAdded) IsNotification()

type ProfilesDeleted

type ProfilesDeleted struct {
	DeletedProfiles []ProfileID `json:"deleted-profiles"`
}

func (ProfilesDeleted) IsNotification

func (p ProfilesDeleted) IsNotification()

type ProxyStatus

type ProxyStatus struct {
	Connection string  `json:"connection"`
	Profile    Profile `json:"profile"`
}

func (ProxyStatus) IsNotification

func (p ProxyStatus) IsNotification()

type ServerNotification

type ServerNotification interface {
	IsNotification()
}

type SubscriptionUpdated

type SubscriptionUpdated struct {
	GroupId  int       `json:"group_id"`
	Profiles []Profile `json:"profiles"`
}

func (SubscriptionUpdated) IsNotification

func (s SubscriptionUpdated) IsNotification()

type TcpMessage

type TcpMessage struct {
	Msg  string          `json:"msg"`
	Data json.RawMessage `json:"data"`
}

type TestProfileData

type TestProfileData struct {
	Profile ProfileID `json:"profile"`
}

type TunStatus

type TunStatus struct {
	IsEnabled bool `json:"is_enabled"`
}

func (TunStatus) IsNotification

func (t TunStatus) IsNotification()

type TunViewEnter

type TunViewEnter struct{}

type TunViewExit

type TunViewExit struct{}

type UpdateProfileData

type UpdateProfileData struct {
	Profile ProfileID
	Name    string
}

type UpdateProfileEnter

type UpdateProfileEnter struct{}

type UpdateProfileExit

type UpdateProfileExit struct{}

type UpdateSubscriptionData

type UpdateSubscriptionData struct {
	GroupId int `json:"group_id"`
}

type Warning

type Warning struct {
	Key     string `json:"key"`
	Content string `json:"content"`
}

func (Warning) IsNotification

func (w Warning) IsNotification()

Jump to

Keyboard shortcuts

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