auth

package
v0.0.0-...-4be93eb Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2016 License: Apache-2.0 Imports: 5 Imported by: 12

README

Auth Protobuf Messages and Services

Generating the code

$ go get -a github.com/golang/protobuf/protoc-gen-go

From this directory generate the go source using the protoc tool with the Go plugin:

$ protoc --go_out=plugins=grpc:. auth.proto 

Documentation

Overview

Package auth is a generated protocol buffer package.

It is generated from these files:

auth.proto

It has these top-level messages:

LoginRequest
LoginResponse
User

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAuthServer

func RegisterAuthServer(s *grpc.Server, srv AuthServer)

Types

type AuthClient

type AuthClient interface {
	Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
}

func NewAuthClient

func NewAuthClient(cc *grpc.ClientConn) AuthClient

type AuthServer

type AuthServer interface {
	Login(context.Context, *LoginRequest) (*LoginResponse, error)
}

type LoginRequest

type LoginRequest struct {
	Username string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password" json:"password,omitempty"`
}

The request message containing the username and password.

func (*LoginRequest) Descriptor

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

func (*LoginRequest) ProtoMessage

func (*LoginRequest) ProtoMessage()

func (*LoginRequest) Reset

func (m *LoginRequest) Reset()

func (*LoginRequest) String

func (m *LoginRequest) String() string

type LoginResponse

type LoginResponse struct {
	Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
}

The response message containing the JWT token.

func (*LoginResponse) Descriptor

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

func (*LoginResponse) ProtoMessage

func (*LoginResponse) ProtoMessage()

func (*LoginResponse) Reset

func (m *LoginResponse) Reset()

func (*LoginResponse) String

func (m *LoginResponse) String() string

type User

type User struct {
	Email        string `protobuf:"bytes,1,opt,name=email" json:"email,omitempty"`
	Username     string `protobuf:"bytes,2,opt,name=username" json:"username,omitempty"`
	PasswordHash string `protobuf:"bytes,3,opt,name=passwordHash" json:"passwordHash,omitempty"`
	IsAdmin      bool   `protobuf:"varint,4,opt,name=isAdmin" json:"isAdmin,omitempty"`
}

The user message containing the user.

func (*User) Descriptor

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

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

Jump to

Keyboard shortcuts

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