adapter

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

Adapter

Clash API

// This script is designed to initiate the sing-box process // with the necessary configuration to enable clash_api for node switching capabilities. // According to the documentation available at // https://sing-box.sagernet.org/configuration/experimental/clash-api/ // it's essential to ensure that clash_api is activated within // the configuration JSON. If clash_api is not already enabled, // the script will modify the JSON file under // the 'experimental' section by appending: // { // "external_controller": "127.0.0.1:9090", // "secret": "", // } // This adjustment allows the sing-box process to start with support // for functionalities accessible through clash_api, such as node // switching and proxy mode toggling. Given the program's design // requirement to support the clash kernel, this approach enables // control over functionalities of both kernels exclusively through clash_api.

Documentation

Index

Constants

View Source
const (
	SingBoxName = "sing-box"
	ClashName   = "mihomo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	Runner
	Killer
}

func NewAdapter

func NewAdapter(ctx context.Context, user *ent.User) Adapter

type Clash

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

func (*Clash) Start

func (m *Clash) Start()

func (*Clash) Stop

func (m *Clash) Stop()

type Killer

type Killer interface {
	Stop()
}

type Runner

type Runner interface {
	Start()
}

type SingBox

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

func (*SingBox) Start

func (s *SingBox) Start()

func (*SingBox) Stop

func (s *SingBox) Stop()

Jump to

Keyboard shortcuts

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