@@ -35,6 +35,8 @@ defmodule OCI.Storage.Adapter do
3535 ```
3636 """
3737
38+ alias OCI.Registry
39+
3840 @ type t :: struct ( )
3941
4042 @ type error_details_t :: any ( )
@@ -44,8 +46,8 @@ defmodule OCI.Storage.Adapter do
4446 """
4547 @ callback blob_exists? (
4648 storage :: t ( ) ,
47- repo :: String . t ( ) ,
48- digest :: String . t ( ) ,
49+ repo :: Registry . repo_t ( ) ,
50+ digest :: Registry . digest_t ( ) ,
4951 ctx :: OCI.Context . t ( )
5052 ) ::
5153 boolean ( )
@@ -55,8 +57,8 @@ defmodule OCI.Storage.Adapter do
5557 """
5658 @ callback cancel_blob_upload (
5759 storage :: t ( ) ,
58- repo :: String . t ( ) ,
59- uuid :: String . t ( ) ,
60+ repo :: Registry . repo_t ( ) ,
61+ uuid :: Registry . uuid_t ( ) ,
6062 ctx :: OCI.Context . t ( )
6163 ) ::
6264 :ok
@@ -68,9 +70,9 @@ defmodule OCI.Storage.Adapter do
6870 """
6971 @ callback complete_blob_upload (
7072 storage :: t ( ) ,
71- repo :: String . t ( ) ,
72- upload_id :: String . t ( ) ,
73- digest :: String . t ( ) ,
73+ repo :: Registry . repo_t ( ) ,
74+ upload_id :: Registry . uuid_t ( ) ,
75+ digest :: Registry . digest_t ( ) ,
7476 ctx :: OCI.Context . t ( )
7577 ) ::
7678 :ok | { :error , atom ( ) } | { :error , atom ( ) , error_details_t }
@@ -80,8 +82,8 @@ defmodule OCI.Storage.Adapter do
8082 """
8183 @ callback delete_blob (
8284 storage :: t ( ) ,
83- repo :: String . t ( ) ,
84- digest :: String . t ( ) ,
85+ repo :: Registry . repo_t ( ) ,
86+ digest :: Registry . digest_t ( ) ,
8587 ctx :: OCI.Context . t ( )
8688 ) ::
8789 :ok | { :error , :BLOB_UNKNOWN } | { :error , :BLOB_UNKNOWN , error_details_t }
@@ -91,8 +93,8 @@ defmodule OCI.Storage.Adapter do
9193 """
9294 @ callback delete_manifest (
9395 storage :: t ( ) ,
94- repo :: String . t ( ) ,
95- reference :: String . t ( ) ,
96+ repo :: Registry . repo_t ( ) ,
97+ reference :: Registry . reference_t ( ) ,
9698 ctx :: OCI.Context . t ( )
9799 ) ::
98100 :ok | { :error , atom ( ) }
@@ -102,8 +104,8 @@ defmodule OCI.Storage.Adapter do
102104 """
103105 @ callback get_blob (
104106 storage :: t ( ) ,
105- repo :: String . t ( ) ,
106- digest :: String . t ( ) ,
107+ repo :: Registry . repo_t ( ) ,
108+ digest :: Registry . digest_t ( ) ,
107109 ctx :: OCI.Context . t ( )
108110 ) ::
109111 { :ok , content :: binary ( ) }
@@ -115,8 +117,8 @@ defmodule OCI.Storage.Adapter do
115117 """
116118 @ callback get_manifest (
117119 storage :: t ( ) ,
118- repo :: String . t ( ) ,
119- reference :: String . t ( ) ,
120+ repo :: Registry . repo_t ( ) ,
121+ reference :: Registry . reference_t ( ) ,
120122 ctx :: OCI.Context . t ( )
121123 ) ::
122124 { :ok , manifest :: binary ( ) , content_type :: String . t ( ) }
@@ -127,8 +129,8 @@ defmodule OCI.Storage.Adapter do
127129 """
128130 @ callback get_blob_upload_status (
129131 storage :: t ( ) ,
130- repo :: String . t ( ) ,
131- uuid :: String . t ( ) ,
132+ repo :: Registry . repo_t ( ) ,
133+ uuid :: Registry . uuid_t ( ) ,
132134 ctx :: OCI.Context . t ( )
133135 ) ::
134136 { :ok , range :: String . t ( ) } | { :error , term ( ) } | { :error , term ( ) , error_details_t }
@@ -138,8 +140,8 @@ defmodule OCI.Storage.Adapter do
138140 """
139141 @ callback get_blob_upload_offset (
140142 storage :: t ( ) ,
141- repo :: String . t ( ) ,
142- uuid :: String . t ( ) ,
143+ repo :: Registry . repo_t ( ) ,
144+ uuid :: Registry . uuid_t ( ) ,
143145 ctx :: OCI.Context . t ( )
144146 ) ::
145147 { :ok , size :: non_neg_integer ( ) }
@@ -151,8 +153,8 @@ defmodule OCI.Storage.Adapter do
151153 """
152154 @ callback manifest_exists? (
153155 storage :: t ( ) ,
154- repo :: String . t ( ) ,
155- reference :: String . t ( ) ,
156+ repo :: Registry . repo_t ( ) ,
157+ reference :: Registry . reference_t ( ) ,
156158 ctx :: OCI.Context . t ( )
157159 ) ::
158160 boolean ( )
@@ -166,8 +168,8 @@ defmodule OCI.Storage.Adapter do
166168 @ doc """
167169 Initiates a blob upload session.
168170 """
169- @ callback initiate_blob_upload ( storage :: t ( ) , repo :: String . t ( ) , ctx :: OCI.Context . t ( ) ) ::
170- { :ok , upload_id :: String . t ( ) }
171+ @ callback initiate_blob_upload ( storage :: t ( ) , repo :: Registry . repo_t ( ) , ctx :: OCI.Context . t ( ) ) ::
172+ { :ok , upload_id :: Registry . uuid_t ( ) }
171173 | { :error , term ( ) }
172174 | { :error , term ( ) , error_details_t }
173175
@@ -176,11 +178,11 @@ defmodule OCI.Storage.Adapter do
176178 """
177179 @ callback list_tags (
178180 storage :: t ( ) ,
179- repo :: String . t ( ) ,
181+ repo :: Registry . repo_t ( ) ,
180182 pagination :: OCI.Pagination . t ( ) ,
181183 ctx :: OCI.Context . t ( )
182184 ) ::
183- { :ok , tags :: [ String . t ( ) ] }
185+ { :ok , tags :: [ Registry . tag_t ( ) ] }
184186 | { :error , :NAME_UNKNOWN }
185187 | { :error , :NAME_UNKNOWN , error_details_t }
186188
@@ -189,9 +191,9 @@ defmodule OCI.Storage.Adapter do
189191 """
190192 @ callback mount_blob (
191193 storage :: t ( ) ,
192- repo :: String . t ( ) ,
193- digest :: String . t ( ) ,
194- from_repo :: String . t ( ) ,
194+ repo :: Registry . repo_t ( ) ,
195+ digest :: Registry . digest_t ( ) ,
196+ from_repo :: Registry . repo_t ( ) ,
195197 ctx :: OCI.Context . t ( )
196198 ) ::
197199 :ok | { :error , :BLOB_UNKNOWN } | { :error , :BLOB_UNKNOWN , error_details_t }
@@ -201,10 +203,10 @@ defmodule OCI.Storage.Adapter do
201203 """
202204 @ callback store_manifest (
203205 storage :: t ( ) ,
204- repo :: String . t ( ) ,
205- reference :: String . t ( ) ,
206+ repo :: Registry . repo_t ( ) ,
207+ reference :: Registry . reference_t ( ) ,
206208 manifest :: map ( ) ,
207- manifest_digest :: String . t ( ) ,
209+ manifest_digest :: Registry . digest_t ( ) ,
208210 ctx :: OCI.Context . t ( )
209211 ) ::
210212 :ok
@@ -214,15 +216,16 @@ defmodule OCI.Storage.Adapter do
214216 @ doc """
215217 Checks if a repository exists.
216218 """
217- @ callback repo_exists? ( storage :: t ( ) , repo :: String . t ( ) , ctx :: OCI.Context . t ( ) ) :: boolean ( )
219+ @ callback repo_exists? ( storage :: t ( ) , repo :: Registry . repo_t ( ) , ctx :: OCI.Context . t ( ) ) ::
220+ boolean ( )
218221
219222 @ doc """
220223 Uploads a chunk of data to an ongoing blob upload.
221224 """
222225 @ callback upload_blob_chunk (
223226 storage :: t ( ) ,
224- repo :: String . t ( ) ,
225- uuid :: String . t ( ) ,
227+ repo :: Registry . repo_t ( ) ,
228+ uuid :: Registry . uuid_t ( ) ,
226229 chunk :: binary ( ) ,
227230 content_range :: String . t ( ) ,
228231 ctx :: OCI.Context . t ( )
@@ -239,8 +242,8 @@ defmodule OCI.Storage.Adapter do
239242 """
240243 @ callback list_referrers (
241244 storage :: t ( ) ,
242- repo :: String . t ( ) ,
243- subject_digest :: String . t ( ) ,
245+ repo :: Registry . repo_t ( ) ,
246+ subject_digest :: Registry . digest_t ( ) ,
244247 filters :: map ( ) ,
245248 ctx :: OCI.Context . t ( )
246249 ) ::
@@ -251,8 +254,8 @@ defmodule OCI.Storage.Adapter do
251254 """
252255 @ callback put_referrer (
253256 storage :: t ( ) ,
254- repo :: String . t ( ) ,
255- subject_digest :: String . t ( ) ,
257+ repo :: Registry . repo_t ( ) ,
258+ subject_digest :: Registry . digest_t ( ) ,
256259 descriptor :: map ( ) ,
257260 ctx :: OCI.Context . t ( )
258261 ) ::
@@ -263,8 +266,8 @@ defmodule OCI.Storage.Adapter do
263266 """
264267 @ callback upload_exists? (
265268 storage :: t ( ) ,
266- repo :: String . t ( ) ,
267- uuid :: String . t ( ) ,
269+ repo :: Registry . repo_t ( ) ,
270+ uuid :: Registry . uuid_t ( ) ,
268271 ctx :: OCI.Context . t ( )
269272 ) ::
270273 boolean ( )
0 commit comments