auth

package
v0.0.0-...-47e80b9 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package auth is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAuthServiceHandler

func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterAuthServiceHandler registers the http handlers for service AuthService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAuthServiceHandlerClient

func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error

RegisterAuthServiceHandlerClient registers the http handlers for service AuthService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthServiceClient" to call the correct interceptors.

func RegisterAuthServiceHandlerFromEndpoint

func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAuthServiceHandlerServer

func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error

RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s *grpc.Server, srv AuthServiceServer)

Types

type AuthRequest

type AuthRequest struct {
	UserId               int64    `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"`
	OrgId                int64    `protobuf:"varint,2,opt,name=orgId,proto3" json:"orgId,omitempty"`
	UserName             string   `protobuf:"bytes,3,opt,name=userName,proto3" json:"userName,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AuthRequest) Descriptor

func (*AuthRequest) Descriptor() ([]byte, []int)

func (*AuthRequest) GetOrgId

func (m *AuthRequest) GetOrgId() int64

func (*AuthRequest) GetUserId

func (m *AuthRequest) GetUserId() int64

func (*AuthRequest) GetUserName

func (m *AuthRequest) GetUserName() string

func (*AuthRequest) ProtoMessage

func (*AuthRequest) ProtoMessage()

func (*AuthRequest) Reset

func (m *AuthRequest) Reset()

func (*AuthRequest) String

func (m *AuthRequest) String() string

func (*AuthRequest) XXX_DiscardUnknown

func (m *AuthRequest) XXX_DiscardUnknown()

func (*AuthRequest) XXX_Marshal

func (m *AuthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AuthRequest) XXX_Merge

func (m *AuthRequest) XXX_Merge(src proto.Message)

func (*AuthRequest) XXX_Size

func (m *AuthRequest) XXX_Size() int

func (*AuthRequest) XXX_Unmarshal

func (m *AuthRequest) XXX_Unmarshal(b []byte) error

type AuthResponse

type AuthResponse struct {
	IsActive             bool     `protobuf:"varint,1,opt,name=isActive,proto3" json:"isActive,omitempty"`
	IsOk                 bool     `protobuf:"varint,2,opt,name=isOk,proto3" json:"isOk,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AuthResponse) Descriptor

func (*AuthResponse) Descriptor() ([]byte, []int)

func (*AuthResponse) GetIsActive

func (m *AuthResponse) GetIsActive() bool

func (*AuthResponse) GetIsOk

func (m *AuthResponse) GetIsOk() bool

func (*AuthResponse) ProtoMessage

func (*AuthResponse) ProtoMessage()

func (*AuthResponse) Reset

func (m *AuthResponse) Reset()

func (*AuthResponse) String

func (m *AuthResponse) String() string

func (*AuthResponse) XXX_DiscardUnknown

func (m *AuthResponse) XXX_DiscardUnknown()

func (*AuthResponse) XXX_Marshal

func (m *AuthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AuthResponse) XXX_Merge

func (m *AuthResponse) XXX_Merge(src proto.Message)

func (*AuthResponse) XXX_Size

func (m *AuthResponse) XXX_Size() int

func (*AuthResponse) XXX_Unmarshal

func (m *AuthResponse) XXX_Unmarshal(b []byte) error

type AuthServiceClient

type AuthServiceClient interface {
	Test(ctx context.Context, in *AuthRequest, opts ...grpc.CallOption) (*AuthResponse, error)
}

AuthServiceClient is the client API for AuthService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAuthServiceClient

func NewAuthServiceClient(cc *grpc.ClientConn) AuthServiceClient

type AuthServiceServer

type AuthServiceServer interface {
	Test(context.Context, *AuthRequest) (*AuthResponse, error)
}

AuthServiceServer is the server API for AuthService service.

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct {
}

UnimplementedAuthServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedAuthServiceServer) Test

type User

type User struct {
	// User ID.
	// Will be set automatically on create.
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// Username of the user.
	Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	// The session timeout, in minutes.
	SessionTtl int32 `protobuf:"varint,3,opt,name=session_ttl,json=sessionTTL,proto3" json:"session_ttl,omitempty"`
	// Set to true to make the user a global administrator.
	IsAdmin bool `protobuf:"varint,4,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"`
	// Set to false to disable the user.
	IsActive bool `protobuf:"varint,5,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"`
	// E-mail of the user.
	Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email,omitempty"`
	// Optional note to store with the user.
	Note                 string   `protobuf:"bytes,7,opt,name=note,proto3" json:"note,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*User) Descriptor

func (*User) Descriptor() ([]byte, []int)

func (*User) GetEmail

func (m *User) GetEmail() string

func (*User) GetId

func (m *User) GetId() int64

func (*User) GetIsActive

func (m *User) GetIsActive() bool

func (*User) GetIsAdmin

func (m *User) GetIsAdmin() bool

func (*User) GetNote

func (m *User) GetNote() string

func (*User) GetSessionTtl

func (m *User) GetSessionTtl() int32

func (*User) GetUsername

func (m *User) GetUsername() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*User) XXX_Merge

func (m *User) XXX_Merge(src proto.Message)

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

func (m *User) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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