resource

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: AGPL-3.0, BSD-2-Clause, ISC Imports: 8 Imported by: 0

Documentation

Overview

Package resource implements a client that obtains resource information, and can get/set resource availability

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewToken

func NewToken(audience, subject, secret string, scopes []string, iat, nbf, exp time.Time) (string, error)

Token creates and signs a token

Types

type About

type About struct {
	Name      string   `json:"name"`
	Streams   []string `json:"streams"`
	Tests     []string `json:"tests"`
	TopicStub string   `json:"topic_stub"`
}

type Config

type Config struct {
	BasePath string
	Host     string
	Scheme   string
	Token    string
	Timeout  time.Duration
}

func (*Config) GetResourceAvailability

func (c *Config) GetResourceAvailability(name string) (Status, error)

func (*Config) GetResources

func (c *Config) GetResources() ([]About, error)

func (*Config) SetResourceAvailability

func (c *Config) SetResourceAvailability(name string, available bool, reason string) error

type Status

type Status struct {
	Available bool   `json:"available"`
	Reason    string `json:"reason"`
}

type Token

type Token struct {

	// Scopes controlling access booking system
	Scopes []string `json:"scopes"`

	jwt.RegisteredClaims
}

Token represents a token used for login or booking

Jump to

Keyboard shortcuts

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