platform

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package platform provides a Platform service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL                 string `yaml:"url"`
	AccessToken         string `yaml:"accessToken"`
	EnablePersonalToken bool   `yaml:"enablePersonalTokens"`
}

Config provides configuration for the Platform service.

type PersonalTokenVerifier

type PersonalTokenVerifier interface {
	IsAllowedToken(ctx context.Context, token string) bool
	IsPersonalTokenEnabled() bool
}

PersonalTokenVerifier declares an interface of a struct for Platform Personal Token verification.

type Service

type Service struct {
	Client *platform.Client
	// contains filtered or unexported fields
}

Service defines a Platform service.

func New

func New(ctx context.Context, cfg Config) (*Service, error)

New creates a new platform service.

func (*Service) IsAllowedToken

func (s *Service) IsAllowedToken(ctx context.Context, personalToken string) bool

IsAllowedToken checks if the Platform Personal Token is allowed.

func (*Service) IsPersonalTokenEnabled

func (s *Service) IsPersonalTokenEnabled() bool

IsPersonalTokenEnabled checks if the Platform Personal Token is enabled.

func (*Service) Reload

func (s *Service) Reload(newService *Service)

Reload reloads service configuration.

Jump to

Keyboard shortcuts

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