Version: v0.0.0-...-ec3f271 Latest Latest

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

Go to latest
Published: Apr 12, 2023 License: GPL-3.0 Imports: 18 Imported by: 0


how to add new fields to backend api

  1. add to the struct in status.go
  2. populate it in toJson() method.
  3. modify the bitmask interface in pkg/bitmask/bitmask.go (note: this is a relict from the past, we can probably get rid of since there'll be a single implementation in the foreseeable future).
  4. modify the bitmask struct in pkg/vpn/main.go
  5. modify the bitmask instantiation in pkg/vpn/main.go:Init
  6. implement functionality...




View Source
const OnStatusChanged string = "OnStatusChanged"


This section is empty.


func CheckAuth

func CheckAuth(handler http.HandlerFunc, token string) http.HandlerFunc

func DonateAccepted

func DonateAccepted()

func DonateSeen

func DonateSeen()

func EnableMockBackend

func EnableMockBackend()

func EnableWebAPI

func EnableWebAPI(port string)

func GetTransport

func GetTransport() *C.char

func GetVersion

func GetVersion() *C.char

func InitializeBitmaskContext

func InitializeBitmaskContext(opts *InitOpts)

func InstallHelpers

func InstallHelpers()

func Login

func Login(username, password string)

func Quit

func Quit()

func RefreshContext

func RefreshContext() *C.char

func ResetError

func ResetError(errname string)

func ResetNotification

func ResetNotification(label string)

func SetSnowflake

func SetSnowflake(snowflake bool)

func SetTransport

func SetTransport(label string)

func SetUDP

func SetUDP(udp bool)

func SubscribeToEvent

func SubscribeToEvent(event string, f unsafe.Pointer)

func SwitchOff

func SwitchOff()

func SwitchOn

func SwitchOn()

func UseAutomaticGateway

func UseAutomaticGateway()

func UseLocation

func UseLocation(label string)


type Events

type Events struct {
	OnStatusChanged string

Events are just a enumeration of all the posible events that C functions can be interested in subscribing to. You cannot subscribe to an event that is not listed here.

type InitOpts

type InitOpts struct {
	ProviderOptions  *bitmask.ProviderOpts
	SkipLaunch       bool
	Obfs4            bool
	UDP              bool
	DisableAutostart bool
	StartVPN         string

func InitOptsFromJSON

func InitOptsFromJSON(provider, providersJSON string) *InitOpts

type Providers

type Providers struct {
	Default string                 `json:"default"`
	Data    []bitmask.ProviderOpts `json:"providers"`

Jump to

Keyboard shortcuts

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