resourceset

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

package resourceset is a set of resources that provides a way to map permissions to fields in a struct.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldMapper

type FieldMapper struct {
	// contains filtered or unexported fields
}

func NewFieldMapper

func NewFieldMapper(v any) (*FieldMapper, error)

func (*FieldMapper) Fields

func (f *FieldMapper) Fields() []accesstypes.Field

func (*FieldMapper) Len

func (f *FieldMapper) Len() int

func (*FieldMapper) StructFieldName

func (f *FieldMapper) StructFieldName(tag string) (accesstypes.Field, bool)

type ResourceSet

type ResourceSet struct {
	// contains filtered or unexported fields
}

func New

func New(v any, resource accesstypes.Resource, permissions ...accesstypes.Permission) (*ResourceSet, error)

func (*ResourceSet) BaseResource added in v0.3.3

func (r *ResourceSet) BaseResource() accesstypes.Resource

func (*ResourceSet) ImmutableFields added in v0.4.2

func (r *ResourceSet) ImmutableFields() map[accesstypes.Tag]struct{}

func (*ResourceSet) Permission added in v0.4.0

func (r *ResourceSet) Permission() accesstypes.Permission

func (*ResourceSet) PermissionRequired added in v0.1.0

func (r *ResourceSet) PermissionRequired(fieldName accesstypes.Field, perm accesstypes.Permission) bool

func (*ResourceSet) Permissions added in v0.4.1

func (r *ResourceSet) Permissions() []accesstypes.Permission

func (*ResourceSet) Resource

func (r *ResourceSet) Resource(fieldName accesstypes.Field) accesstypes.Resource

func (*ResourceSet) TagPermissions added in v0.2.0

func (r *ResourceSet) TagPermissions() accesstypes.TagPermissions

Jump to

Keyboard shortcuts

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