Documentation ¶
Index ¶
- func AuthUnaryInterceptor(ctx gcontext.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func GetUsernameFromContext(ctx gcontext.Context) (string, error)
- func NewOriginTypeContext(ctx gcontext.Context, originType OriginType) context.Context
- func NewRESTServer(grpcPort string) (http.Handler, context.CancelFunc, error)
- func NewRPCServer() *grpc.Server
- func NewUsernameContext(ctx gcontext.Context, username string) context.Context
- type AuthService
- type NetworkService
- func (s *NetworkService) Associate(ctx context.Context, req *pb.NetworkAssociateRequest) (*pb.NetworkAssociateResponse, error)
- func (s *NetworkService) Create(ctx context.Context, req *pb.NetworkCreateRequest) (*pb.NetworkCreateResponse, error)
- func (s *NetworkService) Delete(ctx context.Context, req *pb.NetworkDeleteRequest) (*pb.NetworkDeleteResponse, error)
- func (s *NetworkService) Dissociate(ctx context.Context, req *pb.NetworkDissociateRequest) (*pb.NetworkDissociateResponse, error)
- func (s *NetworkService) GetAllTypes(ctx context.Context, req *pb.NetworkGetAllTypesRequest) (*pb.NetworkGetAllTypesResponse, error)
- func (s *NetworkService) GetAssociatedUsers(ctx context.Context, req *pb.NetworkGetAssociatedUsersRequest) (*pb.NetworkGetAssociatedUsersResponse, error)
- func (s *NetworkService) List(ctx context.Context, req *pb.NetworkListRequest) (*pb.NetworkListResponse, error)
- type OriginType
- type UserService
- func (s *UserService) Create(ctx context.Context, req *pb.UserCreateRequest) (*pb.UserResponse, error)
- func (s *UserService) Delete(ctx context.Context, req *pb.UserDeleteRequest) (*pb.UserResponse, error)
- func (s *UserService) GenConfig(ctx context.Context, req *pb.UserGenConfigRequest) (*pb.UserGenConfigResponse, error)
- func (s *UserService) List(ctx context.Context, req *pb.UserListRequest) (*pb.UserResponse, error)
- func (s *UserService) Renew(ctx context.Context, req *pb.UserRenewRequest) (*pb.UserResponse, error)
- func (s *UserService) Update(ctx context.Context, req *pb.UserUpdateRequest) (*pb.UserResponse, error)
- type VPNService
- func (s *VPNService) Init(ctx context.Context, req *pb.VPNInitRequest) (*pb.VPNInitResponse, error)
- func (s *VPNService) Restart(ctx context.Context, req *pb.VPNRestartRequest) (*pb.VPNRestartResponse, error)
- func (s *VPNService) Status(ctx context.Context, req *pb.VPNStatusRequest) (*pb.VPNStatusResponse, error)
- func (s *VPNService) Update(ctx context.Context, req *pb.VPNUpdateRequest) (*pb.VPNUpdateResponse, error)
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
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 ¶
NewRESTServer returns a new REST server.
Types ¶
type AuthService ¶ added in v0.1.15
type AuthService struct {
pb.UnimplementedAuthServiceServer
}
func (*AuthService) Authenticate ¶ added in v0.1.15
func (s *AuthService) Authenticate(ctx context.Context, req *pb.AuthAuthenticateRequest) (*pb.AuthAuthenticateResponse, error)
func (*AuthService) Status ¶ added in v0.1.15
func (s *AuthService) Status(ctx context.Context, req *pb.AuthStatusRequest) (*pb.AuthStatusResponse, error)
type NetworkService ¶
type NetworkService struct {
pb.UnimplementedNetworkServiceServer
}
func (*NetworkService) Associate ¶
func (s *NetworkService) Associate(ctx context.Context, req *pb.NetworkAssociateRequest) (*pb.NetworkAssociateResponse, error)
func (*NetworkService) Create ¶
func (s *NetworkService) Create(ctx context.Context, req *pb.NetworkCreateRequest) (*pb.NetworkCreateResponse, error)
func (*NetworkService) Delete ¶
func (s *NetworkService) Delete(ctx context.Context, req *pb.NetworkDeleteRequest) (*pb.NetworkDeleteResponse, error)
func (*NetworkService) Dissociate ¶
func (s *NetworkService) Dissociate(ctx context.Context, req *pb.NetworkDissociateRequest) (*pb.NetworkDissociateResponse, error)
func (*NetworkService) GetAllTypes ¶
func (s *NetworkService) GetAllTypes(ctx context.Context, req *pb.NetworkGetAllTypesRequest) (*pb.NetworkGetAllTypesResponse, error)
func (*NetworkService) GetAssociatedUsers ¶
func (s *NetworkService) GetAssociatedUsers(ctx context.Context, req *pb.NetworkGetAssociatedUsersRequest) (*pb.NetworkGetAssociatedUsersResponse, error)
func (*NetworkService) List ¶
func (s *NetworkService) List(ctx context.Context, req *pb.NetworkListRequest) (*pb.NetworkListResponse, error)
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 (s *UserService) Create(ctx context.Context, req *pb.UserCreateRequest) (*pb.UserResponse, error)
func (*UserService) Delete ¶
func (s *UserService) Delete(ctx context.Context, req *pb.UserDeleteRequest) (*pb.UserResponse, error)
func (*UserService) GenConfig ¶
func (s *UserService) GenConfig(ctx context.Context, req *pb.UserGenConfigRequest) (*pb.UserGenConfigResponse, error)
func (*UserService) List ¶
func (s *UserService) List(ctx context.Context, req *pb.UserListRequest) (*pb.UserResponse, error)
func (*UserService) Renew ¶
func (s *UserService) Renew(ctx context.Context, req *pb.UserRenewRequest) (*pb.UserResponse, error)
func (*UserService) Update ¶
func (s *UserService) Update(ctx context.Context, req *pb.UserUpdateRequest) (*pb.UserResponse, error)
type VPNService ¶
type VPNService struct {
pb.UnimplementedVPNServiceServer
}
func (*VPNService) Init ¶
func (s *VPNService) Init(ctx context.Context, req *pb.VPNInitRequest) (*pb.VPNInitResponse, error)
func (*VPNService) Restart ¶ added in v0.2.5
func (s *VPNService) Restart(ctx context.Context, req *pb.VPNRestartRequest) (*pb.VPNRestartResponse, error)
func (*VPNService) Status ¶
func (s *VPNService) Status(ctx context.Context, req *pb.VPNStatusRequest) (*pb.VPNStatusResponse, error)
func (*VPNService) Update ¶
func (s *VPNService) Update(ctx context.Context, req *pb.VPNUpdateRequest) (*pb.VPNUpdateResponse, error)
Click to show internal directories.
Click to hide internal directories.