Class GoBackend

  • All Implemented Interfaces:

    public final class GoBackend
    extends java.lang.Object
    implements Backend
    Implementation of Backend that uses the wireguard-go userspace implementation to provide WireGuard tunnels.
    • Constructor Detail

      • GoBackend

        public GoBackend​(android.content.Context context)
        Public constructor for GoBackend.
        context - An Android Context
    • Method Detail

      • getRunningTunnelNames

        public java.util.Set<java.lang.String> getRunningTunnelNames()
        Method to get the names of running tunnels.
        Specified by:
        getRunningTunnelNames in interface Backend
        A set of string values denoting names of running tunnels.
      • getVersion

        public java.lang.String getVersion()
        Get the version of the underlying wireguard-go library.
        Specified by:
        getVersion in interface Backend
        String value of the version of the wireguard-go library.
      • setState

        public Tunnel.State setState​(Tunnel tunnel,
                                     Tunnel.State state,
                                     Config config)
                              throws java.lang.Exception
        Change the state of a given Tunnel, optionally applying a given Config.
        Specified by:
        setState in interface Backend
        tunnel - The tunnel to control the state of.
        state - The new state for this tunnel. Must be UP, DOWN, or TOGGLE.
        config - The configuration for this tunnel, may be null if state is DOWN.
        Tunnel.State of the tunnel after state changes are applied.
        java.lang.Exception - Exception raised while changing tunnel state.