api

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: AGPL-3.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthUnaryInterceptor added in v0.1.15

func AuthUnaryInterceptor(ctx gcontext.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

AuthUnaryInterceptor is a interceptor function.

See https://godoc.org/google.golang.org/grpc#UnaryServerInterceptor.

func GetUsernameFromContext added in v0.1.15

func GetUsernameFromContext(ctx gcontext.Context) (string, error)

GetUsernameFromContext returns the Username from context.

func NewOriginTypeContext added in v0.1.15

func NewOriginTypeContext(ctx gcontext.Context, originType OriginType) context.Context

NewOriginTypeContext creates a new ctx from the OriginType.

func NewRESTServer

func NewRESTServer(grpcPort string) (http.Handler, context.CancelFunc, error)

NewRESTServer returns a new REST server.

func NewRPCServer

func NewRPCServer() *grpc.Server

NewRPCServer returns a new gRPC server.

func NewUsernameContext added in v0.1.15

func NewUsernameContext(ctx gcontext.Context, username string) context.Context

NewUsernameContext creates a new ctx from username and returns it.

Types

type AuthService added in v0.1.15

type AuthService struct {
	pb.UnimplementedAuthServiceServer
}

func (*AuthService) Authenticate added in v0.1.15

func (*AuthService) Status added in v0.1.15

type NetworkService

type NetworkService struct {
	pb.UnimplementedNetworkServiceServer
}

func (*NetworkService) Associate

func (*NetworkService) Create

func (*NetworkService) Delete

func (*NetworkService) Dissociate

func (*NetworkService) GetAllTypes

func (*NetworkService) List

type OriginType added in v0.1.15

type OriginType int

OriginType indicates where the gRPC request actually came from.

e.g. Is it from REST gateway? Or somewhere else?

const (
	OriginTypeUnknown OriginType = iota
	OriginTypeREST
)

Known origins

func GetOriginTypeFromContext added in v0.1.15

func GetOriginTypeFromContext(ctx gcontext.Context) OriginType

GetOriginTypeFromContext returns the OriginType from context.

type UserService

type UserService struct {
	pb.UnimplementedUserServiceServer
}

func (*UserService) Create

func (*UserService) Delete

func (*UserService) GenConfig

func (*UserService) List

func (*UserService) Renew

func (*UserService) Update

type VPNService

type VPNService struct {
	pb.UnimplementedVPNServiceServer
}

func (*VPNService) Init

func (*VPNService) Restart added in v0.2.5

func (*VPNService) Status

func (*VPNService) Update

Directories

Path Synopsis
Package pb is a reverse proxy.
Package pb is a reverse proxy.

Jump to

Keyboard shortcuts

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