service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: Apache-2.0 Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartGRPCServer

func StartGRPCServer(tokenService *TokenService) *grpc.Server

func StartServers

func StartServers(cfg Config) error

Types

type AuthInterceptor

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

gRPC Server

func NewAuthInterceptor

func NewAuthInterceptor(publicKey string) *AuthInterceptor

func (*AuthInterceptor) Stream

func (interceptor *AuthInterceptor) Stream() grpc.StreamServerInterceptor

func (*AuthInterceptor) Unary

func (interceptor *AuthInterceptor) Unary() grpc.UnaryServerInterceptor

type Config

type Config = config.Config

type Token

type Token struct {
	*oauth2.Token
}

TokenService represents a service for managing OAuth2 tokens.

type TokenService

type TokenService struct {
	proto.UnimplementedTokenServer
	// contains filtered or unexported fields
}

TokenService represents a service for managing OAuth2 tokens.

func NewTokenService

func NewTokenService(cfg Config) *TokenService

NewTokenService creates a new instance of TokenService.

func (*TokenService) Load

func (s *TokenService) Load() error

func (*TokenService) RetrieveInstallation

func (s *TokenService) RetrieveInstallation(ctx context.Context, req *proto.Installation) (*proto.Installation, error)

RetrieveToken retrieves an OAuth2 token for a given GitHub user login name.

func (*TokenService) RetrieveToken

func (s *TokenService) RetrieveToken(ctx context.Context, req *proto.SingleToken) (*proto.SingleToken, error)

RetrieveToken retrieves an OAuth2 token for a given GitHub user login name.

func (*TokenService) RevokeToken

func (s *TokenService) RevokeToken(ctx context.Context, req *proto.SingleToken) (*proto.RevokeMessage, error)

RevokeToken(context.Context, *SingleToken) (*RevokeMessage, error)

func (*TokenService) Save

func (s *TokenService) Save() error

func (*TokenService) StoreInstallation

func (s *TokenService) StoreInstallation(ctx context.Context, req *proto.Installation) (*proto.Installation, error)

UpdateToken updates an existing OAuth2 token for a given GitHub user login name.

func (*TokenService) StoreToken

func (s *TokenService) StoreToken(ctx context.Context, req *proto.SingleToken) (*proto.SingleToken, error)

func (*TokenService) SyncWithError

func (s *TokenService) SyncWithError(ctx context.Context, period time.Duration, errCh chan<- error)

func (*TokenService) UpdateToken

func (s *TokenService) UpdateToken(ctx context.Context, req *proto.SingleToken) (*proto.SingleToken, error)

StoreToken stores an OAuth2 token for a given GitHub user login name.

Jump to

Keyboard shortcuts

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