Help us shape the future of Go! Take the 2026 Go Developer Survey

resource

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: GPL-3.0 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