Documentation ¶
Overview ¶
Package test contains common logic used across the test suites in the diginfractl project.
Index ¶
- func CreateEmptyFile(name string) (string, error)
- func DependenciesFromReader(descReader io.Reader) (*oci.ArtifactConfig, error)
- func FreePort() (int, error)
- func ImageIndexFromReader(descReader io.Reader) (*v1.Index, error)
- func IndexFromReader(descReader io.Reader) (*v1.Index, error)
- func ManifestFromReader(descReader io.Reader) (*v1.Manifest, error)
- func NewOrasRegistry(host string, plainHTTP bool) (*remote.Registry, error)
- func StartOAuthServer(ctx context.Context, port int) error
- func StartRegistry(ctx context.Context, cfg *configuration.Configuration) error
- func WriteToTmpFile(data, dirPath string) (string, error)
- type Layer
- type PluginArtifact
- type RegistryTLSConfig
- type RulesfileArtifact
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEmptyFile ¶
CreateEmptyFile create a directory + file under /tmp.
func DependenciesFromReader ¶
func DependenciesFromReader(descReader io.Reader) (*oci.ArtifactConfig, error)
DependenciesFromReader extracts oci.ArtifactConfig from a reader.
func FreePort ¶
FreePort get a free port on the system by listening in a socket, checking the bound port number and then closing the socket.
func ImageIndexFromReader ¶
ImageIndexFromReader extracts v1.Index from a reader.
func IndexFromReader ¶
IndexFromReader extracts a v1.Index from a reader.
func ManifestFromReader ¶
ManifestFromReader extracts a v1.Manifest from a reader.
func NewOrasRegistry ¶
NewOrasRegistry creates a registry to interact with a remote OCI registry.
func StartOAuthServer ¶
StartOAuthServer starts a new OAuth server.
func StartRegistry ¶
func StartRegistry(ctx context.Context, cfg *configuration.Configuration) error
StartRegistry starts a new OCI registry and returns it's address.
func WriteToTmpFile ¶
WriteToTmpFile writes data to a temporary file in the specified path.
Types ¶
type Layer ¶
type Layer struct { Config *oci.ArtifactConfig Manifest *v1.Manifest }
Layer holds config and manifest for an artifact.
type PluginArtifact ¶
type PluginArtifact struct { Descriptor *v1.Descriptor Index *v1.Index Platforms map[string]*Layer Tags []string }
PluginArtifact holds OCI metadata for a plugin artifact.
func FetchPluginFromRegistry ¶
func FetchPluginFromRegistry(ctx context.Context, ref, tag string, orasRegistry *remote.Registry) (*PluginArtifact, error)
FetchPluginFromRegistry fetches metadata for a plugin artifact.
type RegistryTLSConfig ¶
type RegistryTLSConfig struct { CipherSuites []string CertificatePath string PrivateKeyPath string Certificate *tls.Certificate }
RegistryTLSConfig maintains all certificate informations.
func BuildRegistryTLSConfig ¶
func BuildRegistryTLSConfig(tmpDir string, cipherSuites []string) (*RegistryTLSConfig, error)
BuildRegistryTLSConfig creates a new RegistryTLSConfig.
type RulesfileArtifact ¶
type RulesfileArtifact struct { Descriptor *v1.Descriptor Layer *Layer Tags []string }
RulesfileArtifact holds OCI metadata for a rulesfile artifact.
func FetchRulesfileFromRegistry ¶
func FetchRulesfileFromRegistry(ctx context.Context, ref, tag string, orasRegistry *remote.Registry) (*RulesfileArtifact, error)
FetchRulesfileFromRegistry fetches metadata for a plugin artifact.