service

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	jwt.StandardClaims
}

Claims defines the token claims.

type Config

type Config struct {
	*config.Config
}

Config for iam-proxy-v1 Service

type Service

type Service struct {
	Config
	IAM models.IAM
	// contains filtered or unexported fields
}

Service implements business logic of iam-proxy-v1 Service

func (*Service) GenerateToken

func (s *Service) GenerateToken(_ context.Context, clientID, clientSecret string) (string, string, int64, error)

GenerateToken generates a secret token for the provided app.

func (*Service) Health

func (s *Service) Health(_ context.Context) (health.Health, error)

Health performs health checks and returns the health of the service

func (*Service) ParseToken

func (s *Service) ParseToken(tokenString string) (string, error)

ParseToken parses the token and confirms its validity.

func (*Service) Ready

func (s *Service) Ready(_ context.Context) error

Ready returns non-nil response if service is ready to receive requests

type Servicer

type Servicer interface {
	Health(ctx context.Context) (health.Health, error)
	Ready(ctx context.Context) error
	GenerateToken(ctx context.Context, key, secret string) (string, string, int64, error)
	ParseToken(tokenString string) (string, error)
}

Servicer interface of service

func New

func New(c Config) (Servicer, error)

New creates and initializes iam-proxy-v1 Service

func NewWithMetrics

func NewWithMetrics(base Servicer, instanceName string) Servicer

NewWithMetrics returns an instance of the Servicer decorated with metrics

func NewWithTracing

func NewWithTracing(base Servicer, instanceName string) Servicer

NewWithTracing returns an instance of the Servicer decorated with tracing

type ServicerWithMetrics

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

ServicerWithMetrics implements Servicer interface with all methods wrapped with metrics

func (ServicerWithMetrics) GenerateToken

func (_d ServicerWithMetrics) GenerateToken(ctx context.Context, key string, secret string) (s1 string, s2 string, i1 int64, err error)

GenerateToken implements Servicer

func (ServicerWithMetrics) Health

func (_d ServicerWithMetrics) Health(ctx context.Context) (h1 health.Health, err error)

Health implements Servicer

func (ServicerWithMetrics) ParseToken

func (_d ServicerWithMetrics) ParseToken(tokenString string) (s1 string, err error)

ParseToken implements Servicer

func (ServicerWithMetrics) Ready

func (_d ServicerWithMetrics) Ready(ctx context.Context) (err error)

Ready implements Servicer

type ServicerWithTracing

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

ServicerWithTracing implements Servicer interface with all methods wrapped with Trace

func (ServicerWithTracing) GenerateToken

func (_d ServicerWithTracing) GenerateToken(ctx context.Context, key string, secret string) (s1 string, s2 string, i1 int64, err error)

GenerateToken implements Servicer

func (ServicerWithTracing) Health

func (_d ServicerWithTracing) Health(ctx context.Context) (h1 health.Health, err error)

Health implements Servicer

func (ServicerWithTracing) ParseToken

func (_d ServicerWithTracing) ParseToken(tokenString string) (s1 string, err error)

ParseToken implements Servicer

func (ServicerWithTracing) Ready

func (_d ServicerWithTracing) Ready(ctx context.Context) (err error)

Ready implements Servicer

Directories

Path Synopsis
Package mock_service is a generated GoMock package.
Package mock_service is a generated GoMock package.

Jump to

Keyboard shortcuts

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