Search in sources :

Example 1 with MultiReadDocker

use of com.artipie.docker.composite.MultiReadDocker in project artipie by artipie.

the class DockerProxy method delegate.

/**
 * Creates Docker proxy repository slice from configuration.
 *
 * @return Docker proxy slice.
 */
private Slice delegate() {
    final Docker proxies = new MultiReadDocker(this.cfg.proxy().remotes().stream().map(remote -> proxy(this.client, remote)).collect(Collectors.toList()));
    Docker docker = this.cfg.storageOpt().<Docker>map(storage -> {
        final AstoDocker local = new AstoDocker(new SubStorage(RegistryRoot.V2, storage));
        return new ReadWriteDocker(new MultiReadDocker(local, proxies), local);
    }).orElse(proxies);
    if (!this.standalone) {
        docker = new TrimmedDocker(docker, this.cfg.name());
    }
    Slice slice = new DockerSlice(docker, new DockerPermissions(this.perms), new BasicAuthScheme(this.auth));
    if (!this.standalone) {
        slice = new DockerRoutingSlice.Reverted(slice);
    }
    return slice;
}
Also used : SubStorage(com.artipie.asto.SubStorage) RepoConfig(com.artipie.repo.RepoConfig) BasicAuthScheme(com.artipie.http.auth.BasicAuthScheme) AstoDocker(com.artipie.docker.asto.AstoDocker) Slice(com.artipie.http.Slice) Permissions(com.artipie.http.auth.Permissions) Publisher(org.reactivestreams.Publisher) Response(com.artipie.http.Response) MultiReadDocker(com.artipie.docker.composite.MultiReadDocker) DockerSlice(com.artipie.docker.http.DockerSlice) Collectors(java.util.stream.Collectors) ByteBuffer(java.nio.ByteBuffer) AuthClientSlice(com.artipie.http.client.auth.AuthClientSlice) TrimmedDocker(com.artipie.docker.http.TrimmedDocker) RegistryRoot(com.artipie.docker.asto.RegistryRoot) CacheDocker(com.artipie.docker.cache.CacheDocker) ReadWriteDocker(com.artipie.docker.composite.ReadWriteDocker) ClientSlices(com.artipie.http.client.ClientSlices) ProxyDocker(com.artipie.docker.proxy.ProxyDocker) ProxyConfig(com.artipie.repo.ProxyConfig) Map(java.util.Map) Authentication(com.artipie.http.auth.Authentication) DockerRoutingSlice(com.artipie.http.DockerRoutingSlice) TrimmedDocker(com.artipie.docker.http.TrimmedDocker) MultiReadDocker(com.artipie.docker.composite.MultiReadDocker) SubStorage(com.artipie.asto.SubStorage) ReadWriteDocker(com.artipie.docker.composite.ReadWriteDocker) AstoDocker(com.artipie.docker.asto.AstoDocker) MultiReadDocker(com.artipie.docker.composite.MultiReadDocker) TrimmedDocker(com.artipie.docker.http.TrimmedDocker) CacheDocker(com.artipie.docker.cache.CacheDocker) ReadWriteDocker(com.artipie.docker.composite.ReadWriteDocker) ProxyDocker(com.artipie.docker.proxy.ProxyDocker) Slice(com.artipie.http.Slice) DockerSlice(com.artipie.docker.http.DockerSlice) AuthClientSlice(com.artipie.http.client.auth.AuthClientSlice) DockerRoutingSlice(com.artipie.http.DockerRoutingSlice) DockerSlice(com.artipie.docker.http.DockerSlice) BasicAuthScheme(com.artipie.http.auth.BasicAuthScheme) AstoDocker(com.artipie.docker.asto.AstoDocker) DockerRoutingSlice(com.artipie.http.DockerRoutingSlice)

Aggregations

SubStorage (com.artipie.asto.SubStorage)1 AstoDocker (com.artipie.docker.asto.AstoDocker)1 RegistryRoot (com.artipie.docker.asto.RegistryRoot)1 CacheDocker (com.artipie.docker.cache.CacheDocker)1 MultiReadDocker (com.artipie.docker.composite.MultiReadDocker)1 ReadWriteDocker (com.artipie.docker.composite.ReadWriteDocker)1 DockerSlice (com.artipie.docker.http.DockerSlice)1 TrimmedDocker (com.artipie.docker.http.TrimmedDocker)1 ProxyDocker (com.artipie.docker.proxy.ProxyDocker)1 DockerRoutingSlice (com.artipie.http.DockerRoutingSlice)1 Response (com.artipie.http.Response)1 Slice (com.artipie.http.Slice)1 Authentication (com.artipie.http.auth.Authentication)1 BasicAuthScheme (com.artipie.http.auth.BasicAuthScheme)1 Permissions (com.artipie.http.auth.Permissions)1 ClientSlices (com.artipie.http.client.ClientSlices)1 AuthClientSlice (com.artipie.http.client.auth.AuthClientSlice)1 ProxyConfig (com.artipie.repo.ProxyConfig)1 RepoConfig (com.artipie.repo.RepoConfig)1 ByteBuffer (java.nio.ByteBuffer)1