scopes

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2019 License: Apache-2.0 Imports: 5 Imported by: 3

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