server

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenTypeAccess  = "0"
	TokenTypeRefresh = "1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapters

type Adapters struct {
	Logr   zerolog.Logger
	Store  db.Store
	Tasks  worker.TaskDistributor
	Mail   mail.Sender
	Hash   hash.HashFunction
	Cache  cache.Cache
	Tokens tokens.TokenBuilder
	Config config.Config
}

type Authenticated

type Authenticated interface {
	Profile() *rpc.User
	ClientIP() string
	UserAgent() string
}

type AuthorizedUser

type AuthorizedUser interface {
	Profile() *rpc.User
	ClientIP() string
	UserAgent() string
	Token() string
	Payload() tokens.Payload
	User() db.User
}

type MetaData

type MetaData interface {
	// contains filtered or unexported methods
}

type Server

type Server struct {
	rpc.UnimplementedTrueAuthServer
	Logr zerolog.Logger
	// contains filtered or unexported fields
}

Server represents the core service of your application.

func New added in v0.4.0

func New(adapters *Adapters) (*Server, error)

NewServer creates a new instance of the Service.

func (*Server) Delete

func (s *Server) Delete(
	ctx context.Context,
	req *rpc.DeleteRequest,
) (*rpc.DeleteResponse, error)

func (*Server) Health

func (s *Server) Health(ctx context.Context, req *rpc.HealthRequest) (*rpc.HealthResponse, error)

func (*Server) Refresh

func (s *Server) Refresh(
	ctx context.Context,
	req *rpc.RefreshRequest,
) (*rpc.RefreshResponse, error)

func (*Server) Reset

func (s *Server) Reset(
	ctx context.Context,
	req *rpc.ResetRequest,
) (*rpc.ResetResponse, error)

func (*Server) SetCookies added in v0.4.2

func (s *Server) SetCookies(ctx context.Context, cookies []http.Cookie) error

func (*Server) SetHeaders added in v0.4.2

func (s *Server) SetHeaders(ctx context.Context, headers map[string]string) error

func (*Server) SetStatusCode added in v0.4.2

func (s *Server) SetStatusCode(ctx context.Context, code int) error

func (*Server) Signin

func (s *Server) Signin(
	ctx context.Context,
	req *rpc.SigninRequest,
) (*rpc.SigninResponse, error)

func (*Server) Signout

func (s *Server) Signout(
	ctx context.Context,
	req *rpc.SignoutRequest,
) (*rpc.SignoutResponse, error)

func (*Server) Signup

func (s *Server) Signup(ctx context.Context, req *rpc.SignupRequest) (*rpc.SignupResponse, error)

func (*Server) User

func (s *Server) User(ctx context.Context, r *rpc.UserRequest) (*rpc.UserResponse, error)

Welcome is a service method that returns a welcome message.

func (*Server) Validate added in v0.4.0

func (s *Server) Validate(
	ctx context.Context,
	req *rpc.ValidateRequest,
) (*rpc.ValidateResponse, error)

func (*Server) Verify

func (s *Server) Verify(ctx context.Context, req *rpc.VerifyRequest) (*rpc.VerifyResponse, error)

func (*Server) Welcome

func (s *Server) Welcome(ctx context.Context, r *rpc.WelcomeRequest) (*rpc.WelcomeResponse, error)

Welcome is a service method that returns a welcome message.

Jump to

Keyboard shortcuts

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