8.0
17 Resolving Inputs
(require xiden/input-info) | package: xiden |
A package input is an instance of input-info.
struct
(struct input-info (name source integrity signature) #:prefab) name : string? source : source? integrity : (or/c #f integrity-info?) signature : (or/c #f signature-info?)
A structure representing a request for exact bytes from a source.
procedure
(make-input-info name [ source integrity signature]) → well-formed-input-info/c name : string? source : source? = null integrity : (or/c #f well-formed-integrity-info/c) = #f signature : (or/c #f well-formed-signature-info/c) = #f
A contracted input-info constructor.
value
=
(struct/c input-info file-name-string? (non-empty-listof string?) (or/c #f well-formed-integrity-info/c) (or/c #f well-formed-signature-info/c))
A contract that recognizes package inputs suitable for use in
package definitions.
value
= (struct/c input-info file-name-string? #f #f #f)
A contract that recognizes package inputs with only a name defined.
value
= (and/c well-formed-input-info/c (not/c abstract-input-info/c))
A contract that recognizes package inputs with a name and a source.
value
procedure
(input-ref name) → (logged/c input-info?)
name : string?
procedure
(find-input inputs name) → (logged/c input-info?)
inputs : (listof input-info?) name : string?
Returns a logged procedure P that either
uses the first input in inputs with the given name,
or fails with $input-not-found on the program log.
procedure
(release-input input) → (logged/c void?)
input : input-info?
procedure
(resolve-input input) → (logged/c path-string?)
input : input-info?
Returns a logged procedure P that, when applied,
acquires and verifies the bytes for input. P
returns a relative path to a symbolic link in
(current-directory).
The process will fail if the bytes do not meet the requirements of input, if no bytes are available, or if the runtime configuration does not place trust in the bytes.
procedure
(keep-input name) → (logged/c path-string?)
name : string?
Use for inputs that you do not intend to release.
A message regarding an input with a given name.
struct
(struct $input:not-found $input ())
Represents a failure to find an input using find-input.
Represents the status for fetching an input from a source.
If errors is empty, then the fetch was successful. Otherwise, the fetch failed, and errors holds messages that explain why.