namespace

package
v2.9.5 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespace used by the server
	DefaultNamespace = "micro"
)

Variables

View Source
var (
	// ErrUnauthorized is returned by Authorize when a context without a blank account tries to access
	// a restricted namespace
	ErrUnauthorized = errors.New("An account is required")
	// ErrForbidden is returned by Authorize when a context is trying to access a namespace it doesn't
	// have access to
	ErrForbidden = errors.New("Access denied to namespace")
)

Functions

func Authorize

func Authorize(ctx context.Context, namespace string, opts ...AuthorizeOption) error

Authorize will return an error if the context cannot access the given namespace

Types

type AuthorizeOption

type AuthorizeOption func(o *AuthorizeOptions)

AuthorizeOption sets an attribute on AuthorizeOptions

func Public

func Public(ns string) AuthorizeOption

Public indicates a namespace is public and can be accessed by anyone

type AuthorizeOptions

type AuthorizeOptions struct {
	PublicNamespace string
}

AuthorizeOptions are used to configure the Authorize method

Jump to

Keyboard shortcuts

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