api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package api is a generated protocol buffer package.

It is generated from these files:

github.com/tomogoma/authms/api/users.proto

It has these top-level messages:

UserName
UserType
VerifLogin
Facebook
Group
Device
User
GetDetailsReq

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterUsersHandler

func RegisterUsersHandler(s server.Server, hdlr UsersHandler, opts ...server.HandlerOption)

Types

type Device

type Device struct {
	ID          string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	UserID      string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
	DeviceID    string `protobuf:"bytes,3,opt,name=deviceID" json:"deviceID,omitempty"`
	Created     string `protobuf:"bytes,4,opt,name=created" json:"created,omitempty"`
	LastUpdated string `protobuf:"bytes,5,opt,name=lastUpdated" json:"lastUpdated,omitempty"`
}

func (*Device) Descriptor

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

func (*Device) GetCreated

func (m *Device) GetCreated() string

func (*Device) GetDeviceID

func (m *Device) GetDeviceID() string

func (*Device) GetID

func (m *Device) GetID() string

func (*Device) GetLastUpdated

func (m *Device) GetLastUpdated() string

func (*Device) GetUserID

func (m *Device) GetUserID() string

func (*Device) ProtoMessage

func (*Device) ProtoMessage()

func (*Device) Reset

func (m *Device) Reset()

func (*Device) String

func (m *Device) String() string

type Facebook

type Facebook struct {
	ID          string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	UserID      string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
	FacebookID  string `protobuf:"bytes,3,opt,name=facebookID" json:"facebookID,omitempty"`
	Verified    bool   `protobuf:"varint,4,opt,name=verified" json:"verified,omitempty"`
	Created     string `protobuf:"bytes,5,opt,name=created" json:"created,omitempty"`
	LastUpdated string `protobuf:"bytes,6,opt,name=lastUpdated" json:"lastUpdated,omitempty"`
}

func (*Facebook) Descriptor

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

func (*Facebook) GetCreated

func (m *Facebook) GetCreated() string

func (*Facebook) GetFacebookID

func (m *Facebook) GetFacebookID() string

func (*Facebook) GetID

func (m *Facebook) GetID() string

func (*Facebook) GetLastUpdated

func (m *Facebook) GetLastUpdated() string

func (*Facebook) GetUserID

func (m *Facebook) GetUserID() string

func (*Facebook) GetVerified

func (m *Facebook) GetVerified() bool

func (*Facebook) ProtoMessage

func (*Facebook) ProtoMessage()

func (*Facebook) Reset

func (m *Facebook) Reset()

func (*Facebook) String

func (m *Facebook) String() string

type GetDetailsReq

type GetDetailsReq struct {
	APIKey string `protobuf:"bytes,1,opt,name=APIKey" json:"APIKey,omitempty"`
	JWT    string `protobuf:"bytes,2,opt,name=JWT" json:"JWT,omitempty"`
	UserID string `protobuf:"bytes,3,opt,name=userID" json:"userID,omitempty"`
}

func (*GetDetailsReq) Descriptor

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

func (*GetDetailsReq) GetAPIKey

func (m *GetDetailsReq) GetAPIKey() string

func (*GetDetailsReq) GetJWT

func (m *GetDetailsReq) GetJWT() string

func (*GetDetailsReq) GetUserID

func (m *GetDetailsReq) GetUserID() string

func (*GetDetailsReq) ProtoMessage

func (*GetDetailsReq) ProtoMessage()

func (*GetDetailsReq) Reset

func (m *GetDetailsReq) Reset()

func (*GetDetailsReq) String

func (m *GetDetailsReq) String() string

type Group

type Group struct {
	ID          string  `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	Name        string  `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	AccessLevel float32 `protobuf:"fixed32,3,opt,name=accessLevel" json:"accessLevel,omitempty"`
	Created     string  `protobuf:"bytes,4,opt,name=created" json:"created,omitempty"`
	LastUpdated string  `protobuf:"bytes,5,opt,name=lastUpdated" json:"lastUpdated,omitempty"`
}

func (*Group) Descriptor

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

func (*Group) GetAccessLevel

func (m *Group) GetAccessLevel() float32

func (*Group) GetCreated

func (m *Group) GetCreated() string

func (*Group) GetID

func (m *Group) GetID() string

func (*Group) GetLastUpdated

func (m *Group) GetLastUpdated() string

func (*Group) GetName

func (m *Group) GetName() string

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) Reset

func (m *Group) Reset()

func (*Group) String

func (m *Group) String() string

type Guard

type Guard struct {
	errors.ClErrCheck
	errors.AuthErrCheck
	// contains filtered or unexported fields
}

func NewGuard

func NewGuard(db KeyStore, opts ...Option) (*Guard, error)

func (*Guard) APIKeyValid

func (s *Guard) APIKeyValid(key string) (string, error)

func (*Guard) NewAPIKey

func (s *Guard) NewAPIKey(userID string) (*Key, error)

type Key

type Key struct {
	ID         string
	UserID     string
	APIKey     string
	CreateDate time.Time
	UpdateDate time.Time
}

type KeyGenerator

type KeyGenerator interface {
	SecureRandomBytes(length int) ([]byte, error)
}

type KeyStore

type KeyStore interface {
	IsNotFoundError(error) bool
	InsertAPIKey(userID, key string) (*Key, error)
	APIKeysByUserID(userID string, offset, count int64) ([]Key, error)
}

type Option

type Option func(*Guard)

func WithKeyGenerator

func WithKeyGenerator(kg KeyGenerator) Option

func WithMasterKey

func WithMasterKey(key string) Option

type User

type User struct {
	ID          string      `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	JWT         string      `protobuf:"bytes,2,opt,name=JWT" json:"JWT,omitempty"`
	Type        *UserType   `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"`
	Username    *UserName   `protobuf:"bytes,4,opt,name=username" json:"username,omitempty"`
	Phone       *VerifLogin `protobuf:"bytes,5,opt,name=phone" json:"phone,omitempty"`
	Email       *VerifLogin `protobuf:"bytes,6,opt,name=email" json:"email,omitempty"`
	Facebook    *Facebook   `protobuf:"bytes,7,opt,name=facebook" json:"facebook,omitempty"`
	Groups      []*Group    `protobuf:"bytes,8,rep,name=groups" json:"groups,omitempty"`
	Devices     []*Device   `protobuf:"bytes,9,rep,name=devices" json:"devices,omitempty"`
	Created     string      `protobuf:"bytes,10,opt,name=created" json:"created,omitempty"`
	LastUpdated string      `protobuf:"bytes,11,opt,name=lastUpdated" json:"lastUpdated,omitempty"`
}

func (*User) Descriptor

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

func (*User) GetCreated

func (m *User) GetCreated() string

func (*User) GetDevices

func (m *User) GetDevices() []*Device

func (*User) GetEmail

func (m *User) GetEmail() *VerifLogin

func (*User) GetFacebook

func (m *User) GetFacebook() *Facebook

func (*User) GetGroups

func (m *User) GetGroups() []*Group

func (*User) GetID

func (m *User) GetID() string

func (*User) GetJWT

func (m *User) GetJWT() string

func (*User) GetLastUpdated

func (m *User) GetLastUpdated() string

func (*User) GetPhone

func (m *User) GetPhone() *VerifLogin

func (*User) GetType

func (m *User) GetType() *UserType

func (*User) GetUsername

func (m *User) GetUsername() *UserName

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

type UserName

type UserName struct {
	ID          string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	UserID      string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
	Value       string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
	Created     string `protobuf:"bytes,4,opt,name=created" json:"created,omitempty"`
	LastUpdated string `protobuf:"bytes,5,opt,name=lastUpdated" json:"lastUpdated,omitempty"`
}

func (*UserName) Descriptor

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

func (*UserName) GetCreated

func (m *UserName) GetCreated() string

func (*UserName) GetID

func (m *UserName) GetID() string

func (*UserName) GetLastUpdated

func (m *UserName) GetLastUpdated() string

func (*UserName) GetUserID

func (m *UserName) GetUserID() string

func (*UserName) GetValue

func (m *UserName) GetValue() string

func (*UserName) ProtoMessage

func (*UserName) ProtoMessage()

func (*UserName) Reset

func (m *UserName) Reset()

func (*UserName) String

func (m *UserName) String() string

type UserType

type UserType struct {
	ID          string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	Name        string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	Created     string `protobuf:"bytes,3,opt,name=created" json:"created,omitempty"`
	LastUpdated string `protobuf:"bytes,4,opt,name=lastUpdated" json:"lastUpdated,omitempty"`
}

func (*UserType) Descriptor

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

func (*UserType) GetCreated

func (m *UserType) GetCreated() string

func (*UserType) GetID

func (m *UserType) GetID() string

func (*UserType) GetLastUpdated

func (m *UserType) GetLastUpdated() string

func (*UserType) GetName

func (m *UserType) GetName() string

func (*UserType) ProtoMessage

func (*UserType) ProtoMessage()

func (*UserType) Reset

func (m *UserType) Reset()

func (*UserType) String

func (m *UserType) String() string

type Users

type Users struct {
	UsersHandler
}

func (*Users) GetDetails

func (h *Users) GetDetails(ctx context.Context, in *GetDetailsReq, out *User) error

type UsersClient

type UsersClient interface {
	GetDetails(ctx context.Context, in *GetDetailsReq, opts ...client.CallOption) (*User, error)
}

func NewUsersClient

func NewUsersClient(serviceName string, c client.Client) UsersClient

type UsersHandler

type UsersHandler interface {
	GetDetails(context.Context, *GetDetailsReq, *User) error
}

type VerifLogin

type VerifLogin struct {
	ID          string `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	UserID      string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"`
	Value       string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
	Verified    bool   `protobuf:"varint,4,opt,name=verified" json:"verified,omitempty"`
	Created     string `protobuf:"bytes,5,opt,name=created" json:"created,omitempty"`
	LastUpdated string `protobuf:"bytes,6,opt,name=lastUpdated" json:"lastUpdated,omitempty"`
}

func (*VerifLogin) Descriptor

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

func (*VerifLogin) GetCreated

func (m *VerifLogin) GetCreated() string

func (*VerifLogin) GetID

func (m *VerifLogin) GetID() string

func (*VerifLogin) GetLastUpdated

func (m *VerifLogin) GetLastUpdated() string

func (*VerifLogin) GetUserID

func (m *VerifLogin) GetUserID() string

func (*VerifLogin) GetValue

func (m *VerifLogin) GetValue() string

func (*VerifLogin) GetVerified

func (m *VerifLogin) GetVerified() bool

func (*VerifLogin) ProtoMessage

func (*VerifLogin) ProtoMessage()

func (*VerifLogin) Reset

func (m *VerifLogin) Reset()

func (*VerifLogin) String

func (m *VerifLogin) String() string

Jump to

Keyboard shortcuts

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