Documentation
¶
Overview ¶
Package exportlibrary is the library a managed script's "resources" export files its output in (#2080): platform.export's scope= and scope_id=, read the way manage_resource reads the same pair. Without scope the output lands in the library of the person the run acts for; with one it lands in the library scope names, and whether the run may write there is the resource rule (resource.CanWriteScope) against the identity the run presents, checked when the script is saved and again when the file is written.
It is kept out of internal/platform/scriptrun for that package's size budget, as exporttable and exportrefs are: the argument's rules and its static read live here, and the engine and the validator call them.
Index ¶
- Variables
- func Check(scope, scopeID string) error
- func CheckArgs(library bool, scope, scopeID, index string) (string, error)
- func CheckFor(library bool, scope, scopeID string) error
- func FromCall(call *syntax.CallExpr, read Reader, resources string) (*Library, *Finding)
- type Finding
- type Library
- type Reader
Constants ¶
This section is empty.
Variables ¶
var ErrIndexNotLibrary = errors.New(`index is how the managed-resource library indexes a file; it applies to destination="resources" only`)
ErrIndexNotLibrary is index= given to a destination that files nothing in the library.
var ErrNotLibrary = errors.New(`scope and scope_id name a library, and only the "resources" destination files an output in one`)
ErrNotLibrary is a scope given to a destination that files nothing in a library.
Functions ¶
func Check ¶
Check checks the scope and scope_id an export names, the same pair manage_resource takes: both empty is the run's own library.
func CheckArgs ¶ added in v1.145.0
CheckArgs is CheckFor and index= together (#2111): index says how search indexes the file, which only a library file has. It returns the policy index names, empty when it names none.
func CheckFor ¶
CheckFor checks the scope and scope_id an export names against whether its destination files in a library: none named is always fine.
func FromCall ¶
FromCall reads the library one platform.export call files in. It returns the library for a "resources" export whose scope arguments are written out, nil for one that files in no library or whose destination is computed, and a Finding for scope arguments a reader cannot state: computed, naming no library, or given to a destination that files in none. resources is the built-in destination's name.
Types ¶
type Finding ¶
Finding is what a source's export says that names no library a reader can state: the message, and the hint that says what to write.
type Library ¶
Library is one library a script's "resources" exports write to, as the source names it: Scope empty is the library of the person the run acts for.
func (Library) Normalized ¶
Normalized states the run's own library one way: scope="user" with no scope_id is the same library as no scope at all.
func (Library) Own ¶
Own reports whether the library is the one the run acts for, which a run can always write to.
func (Library) RecordScope ¶
RecordScope is the library as an export record states it: the scope, and "user" with no id for the run's own.