scopes

package
v0.53.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 5 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	Priority    int    `json:"priority" yaml:"priority"`
	Description string `json:"description,omitempty" yaml:"description"`
	ID          string `json:"id,omitempty"`
}

A Definition contains the meta data for a single scope.

type Scopes

type Scopes struct {
	Mapping     map[string]string      `json:"mapping" yaml:"mapping"`
	Definitions map[string]*Definition `json:"definitions" yaml:"scopes"`
}

Scopes contain collections for scope related meta data

func NewScopesFromFile

func NewScopesFromFile(scopesConfFilepath string, logger logrus.FieldLogger) (*Scopes, error)

NewScopesFromFile loads scope definitions from a file.

func NewScopesFromIDs

func NewScopesFromIDs(scopes map[string]bool, parent *Scopes) *Scopes

NewScopesFromIDs creates a new scopes meta data collection from the provided scopes IDs optionally also adding definitions from a parent.

func (*Scopes) Extend

func (s *Scopes) Extend(scopes *Scopes) error

Extend adds the provided scope mappings and definitions to the accociated scopes mappings and definitions with replacing already existing. If scopes is nil, Extends is a no-op.

Jump to

Keyboard shortcuts

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