auth

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEstablishGRPCConnect = errors.New("fail connect grpc")
	ErrUserNotFound         = errors.New("user not found")
	ErrUnknown              = errors.New("unknown error")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg IOptions) *Client

NewClient can be injectable via wire

func NewClientWithOptions

func NewClientWithOptions(opts ...Option) *Client

NewClientWithOptions alternative

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) FindUsersByIds added in v1.3.1

func (c *Client) FindUsersByIds(ctx context.Context, ids []string) ([]*pb.UserData, error)

func (*Client) Validate

func (c *Client) Validate(ctx context.Context, token string) (*pb.UserData, error)

type IClient added in v1.3.1

type IClient interface {
	Connect() error
	Validate(ctx context.Context, token string) (*pb.UserData, error)
	FindUsersByIds(ctx context.Context, ids []string) ([]*pb.UserData, error)
}

type IOptions

type IOptions interface {
	Options() *Options
}

type Option

type Option func(o *options)

func WithDSN

func WithDSN(dsn string) Option

type Options

type Options struct {
	DSN string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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