ape

package
v0.0.0-...-0352b5b Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidChainRepresentation = errors.New("invalid chain representation")
)

Functions

This section is empty.

Types

type Chain

type Chain struct {
	// Raw is the encoded chain kind.
	// It assumes that Raw's bytes are the result of encoding provided by
	// policy-engine package.
	Raw []byte
}

Chain is an SDK representation for v2's Chain.

Note that Chain (as well as v2's Chain) and all related entities are NOT operated by Access-Policy-Engine (APE). The client is responsible to convert these types to policy-engine entities.

func (*Chain) ReadFromV2

func (c *Chain) ReadFromV2(v2ct *apeV2.Chain) error

ReadFromV2 fills Chain from v2.

func (*Chain) ToV2

func (c *Chain) ToV2() *apeV2.Chain

ToV2 converts Chain to v2.

type ChainID

type ChainID []byte

ChainID is Chain's identifier.

type ChainTarget

type ChainTarget struct {
	TargetType TargetType

	Name string
}

ChainTarget is an SDK representation for v2's ChainTarget.

Note that ChainTarget (as well as v2's ChainTarget) and all related entities are NOT operated by Access-Policy-Engine (APE). The client is responsible to convert these types to policy-engine entities.

func (*ChainTarget) FromV2

func (ct *ChainTarget) FromV2(v2ct *apeV2.ChainTarget)

FromV2 reads ChainTarget frpm v2.

func (*ChainTarget) ToV2

func (ct *ChainTarget) ToV2() *apeV2.ChainTarget

ToV2 converts ChainTarget to v2.

type TargetType

type TargetType apeV2.TargetType

TargetType is an SDK representation for v2's TargetType.

const (
	TargetTypeUndefined TargetType = iota
	TargetTypeNamespace
	TargetTypeContainer
	TargetTypeUser
	TargetTypeGroup
)

func (*TargetType) FromV2

func (targetType *TargetType) FromV2(v2targetType apeV2.TargetType)

FromV2 reads TargetType to v2.

func (TargetType) ToV2

func (targetType TargetType) ToV2() apeV2.TargetType

ToV2 converts TargetType to v2.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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