translator

package
v0.0.0-...-7974e50 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Duration between stream renewal attempts.
	StreamRenewalInterval time.Duration
	JobQueueSize          int
}

type Option

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

func WithLogger

func WithLogger(logger logging.Logger) Option

WithLogger sets the Translator's logger to a given logger. If given logger is nil then no logger is set and default settings apply.

type Translator

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

func NewTranslator

func NewTranslator(grpcClient pb.AuthServiceClient, config Config, opts ...Option) *Translator

NewTranslator returns a new, initialized instance of the Translator. Run() has to be invoked before use. Logging is disabled by default unless a logger option is given.

func (*Translator) Run

func (t *Translator) Run(ctx context.Context)

Run starts up necessary goroutines for automatic stream renewals and job handling. Blocks until given context is cancelled. It is intended to be invoked in a separate goroutine.

func (*Translator) TranslateAccessToken

func (t *Translator) TranslateAccessToken(opaqueAccessToken string) (string, error)

TranslateAccessToken takes in an opaqueAccessToken and translates it to an encoded JWT token or returns a non-nil error.

Jump to

Keyboard shortcuts

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