Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Commit 5d97555

Browse files
committed
update docs
Signed-off-by: Lixia (Sylvia) Lei <[email protected]>
1 parent ed500c2 commit 5d97555

File tree

6 files changed

+70
-52
lines changed

6 files changed

+70
-52
lines changed

file_store.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,35 @@ import (
2424
//
2525
// Reference: https://docs.docker.com/engine/reference/commandline/cli/#docker-cli-configuration-file-configjson-properties
2626
//
27-
// Deprecated: This type is deprecated.
28-
// The same functionality is now provided by oras-go.
27+
// Deprecated: This type is now simply [credentials.FileStore] of oras-go.
28+
//
29+
// [credentials.FileStore]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#FileStore
2930
type FileStore = orascreds.FileStore
3031

3132
var (
3233
// ErrPlaintextPutDisabled is returned by Put() when DisablePut is set
3334
// to true.
3435
//
35-
// Deprecated: This type is deprecated.
36-
// The same functionality is now provided by oras-go.
36+
// Deprecated: This type is now simply [credentials.ErrPlaintextPutDisabled] of oras-go.
37+
//
38+
// [credentials.ErrPlaintextPutDisabled]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#ErrPlaintextPutDisabled
3739
ErrPlaintextPutDisabled = orascreds.ErrPlaintextPutDisabled
3840
// ErrBadCredentialFormat is returned by Put() when the credential format
3941
// is bad.
4042
//
41-
// Deprecated: This type is deprecated.
42-
// The same functionality is now provided by oras-go.
43+
// Deprecated: This type is now simply [credentials.ErrBadCredentialFormat] of oras-go.
44+
//
45+
// [credentials.ErrBadCredentialFormat]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#ErrBadCredentialFormat
4346
ErrBadCredentialFormat = orascreds.ErrBadCredentialFormat
4447
)
4548

4649
// NewFileStore creates a new file credentials store.
4750
//
4851
// Reference: https://docs.docker.com/engine/reference/commandline/cli/#docker-cli-configuration-file-configjson-properties
4952
//
50-
// Deprecated: This function is deprecated.
51-
// The same functionality is now provided by oras-go.
53+
// Deprecated: This funciton now simply calls [credentials.NewFileStore] of oras-go.
54+
//
55+
// [credentials.NewFileStore]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewFileStore
5256
func NewFileStore(configPath string) (*FileStore, error) {
5357
return orascreds.NewFileStore(configPath)
5458
}

memory_store.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ import (
2121

2222
// NewMemoryStore creates a new in-memory credentials store.
2323
//
24-
// Deprecated: This function is deprecated.
25-
// The same functionality is now provided by oras-go.
24+
// Deprecated: This funciton now simply calls [credentials.NewMemoryStore] of oras-go.
25+
//
26+
// [credentials.NewMemoryStore]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewMemoryStore
2627
func NewMemoryStore() Store {
2728
return orascreds.NewMemoryStore()
2829
}

native_store.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ import (
2929
// Reference:
3030
// - https://docs.docker.com/engine/reference/commandline/login#credentials-store
3131
//
32-
// Deprecated: This function is deprecated.
33-
// The same functionality is now provided by oras-go.
32+
// Deprecated: This funciton now simply calls [credentials.NewNativeStore] of oras-go.
33+
//
34+
// [credentials.NewNativeStore]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewNativeStore
3435
func NewNativeStore(helperSuffix string) Store {
3536
return orascreds.NewNativeStore(helperSuffix)
3637
}
@@ -45,8 +46,9 @@ func NewNativeStore(helperSuffix string) Store {
4546
// Reference:
4647
// - https://docs.docker.com/engine/reference/commandline/login/#credentials-store
4748
//
48-
// Deprecated: This function is deprecated.
49-
// The same functionality is now provided by oras-go.
49+
// Deprecated: This funciton now simply calls [credentials.NewDefaultNativeStore] of oras-go.
50+
//
51+
// [credentials.NewDefaultNativeStore]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewDefaultNativeStore
5052
func NewDefaultNativeStore() (Store, bool) {
5153
return orascreds.NewDefaultNativeStore()
5254
}

registry.go

+18-12
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,37 @@ import (
2626
// ErrClientTypeUnsupported is thrown by Login() when the registry's client type
2727
// is not supported.
2828
//
29-
// Deprecated: This type is deprecated.
30-
// The same functionality is now provided by oras-go.
29+
// Deprecated: This type is now simply [credentials.ErrClientTypeUnsupported] of oras-go.
30+
//
31+
// [credentials.ErrClientTypeUnsupported]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#ErrClientTypeUnsupported
3132
var ErrClientTypeUnsupported = orascreds.ErrClientTypeUnsupported
3233

3334
// Login provides the login functionality with the given credentials. The target
3435
// registry's client should be nil or of type *auth.Client. Login uses
3536
// a client local to the function and will not modify the original client of
3637
// the registry.
3738
//
38-
// Deprecated: This function is deprecated.
39-
// The same functionality is now provided by oras-go.
39+
// Deprecated: This funciton now simply calls [credentials.Login] of oras-go.
40+
//
41+
// [credentials.Login]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#Login
4042
func Login(ctx context.Context, store Store, reg *remote.Registry, cred auth.Credential) error {
4143
return orascreds.Login(ctx, store, reg, cred)
4244
}
4345

4446
// Logout provides the logout functionality given the registry name.
4547
//
46-
// Deprecated: This function is deprecated.
47-
// The same functionality is now provided by oras-go.
48+
// Deprecated: This funciton now simply calls [credentials.Logout] of oras-go.
49+
//
50+
// [credentials.Logout]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#Logout
4851
func Logout(ctx context.Context, store Store, registryName string) error {
4952
return orascreds.Logout(ctx, store, registryName)
5053
}
5154

5255
// Credential returns a Credential() function that can be used by auth.Client.
5356
//
54-
// Deprecated: This function is deprecated.
55-
// The same functionality is now provided by oras-go.
57+
// Deprecated: This funciton now simply calls [credentials.Credential] of oras-go.
58+
//
59+
// [credentials.Credential]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#Credential
5660
func Credential(store Store) func(context.Context, string) (auth.Credential, error) {
5761
return orascreds.Credential(store)
5862
}
@@ -62,8 +66,9 @@ func Credential(store Store) func(context.Context, string) (auth.Credential, err
6266
// the registry 'docker.io' will be added under the key "https://index.docker.io/v1/".
6367
// See: https://github.com/moby/moby/blob/v24.0.2/registry/config.go#L25-L48
6468
//
65-
// Deprecated: This function is deprecated.
66-
// The same functionality is now provided by oras-go.
69+
// Deprecated: This funciton now simply calls [credentials.ServerAddressFromRegistry] of oras-go.
70+
//
71+
// [credentials.ServerAddressFromRegistry]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#ServerAddressFromRegistry
6772
func ServerAddressFromRegistry(registry string) string {
6873
return orascreds.ServerAddressFromRegistry(registry)
6974
}
@@ -73,8 +78,9 @@ func ServerAddressFromRegistry(registry string) string {
7378
// host "registry-1.docker.io" will be redirected to "https://index.docker.io/v1/".
7479
// See: https://github.com/moby/moby/blob/v24.0.2/registry/config.go#L25-L48
7580
//
76-
// Deprecated: This function is deprecated.
77-
// The same functionality is now provided by oras-go.
81+
// Deprecated: This funciton now simply calls [credentials.ServerAddressFromHostname] of oras-go.
82+
//
83+
// [credentials.ServerAddressFromHostname]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#ServerAddressFromHostname
7884
func ServerAddressFromHostname(hostname string) string {
7985
return orascreds.ServerAddressFromHostname(hostname)
8086
}

store.go

+20-14
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ limitations under the License.
1414
*/
1515

1616
// Deprecated: This package is deprecated.
17-
// The same functionality is now provided by [oras-go].
17+
// The same functionality is now provided by [oras.land/oras-go/v2/registry/remote/credentials].
1818
//
19-
// [oras-go]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials
19+
// [oras.land/oras-go/v2/registry/remote/credentials]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials
2020
package credentials
2121

2222
import (
@@ -25,21 +25,24 @@ import (
2525

2626
// Store is the interface that any credentials store must implement.
2727
//
28-
// Deprecated: This type is deprecated.
29-
// The same functionality is now provided by oras-go.
28+
// Deprecated: This type is now simply [credentials.Store] of oras-go.
29+
//
30+
// [credentials.Store]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#Store
3031
type Store = orascreds.Store
3132

3233
// DynamicStore dynamically determines which store to use based on the settings
3334
// in the config file.
3435
//
35-
// Deprecated: This type is deprecated.
36-
// The same functionality is now provided by oras-go.
36+
// Deprecated: This type is now simply [credentials.DynamicStore] of oras-go.
37+
//
38+
// [credentials.DynamicStore]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#DynamicStore
3739
type DynamicStore = orascreds.DynamicStore
3840

3941
// StoreOptions provides options for NewStore.
4042
//
41-
// Deprecated: This type is deprecated.
42-
// The same functionality is now provided by oras-go.
43+
// Deprecated: This type is now simply [credentials.StoreOptions] of oras-go.
44+
//
45+
// [credentials.StoreOptions]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#StoreOptions
4346
type StoreOptions = orascreds.StoreOptions
4447

4548
// NewStore returns a Store based on the given configuration file.
@@ -55,8 +58,9 @@ type StoreOptions = orascreds.StoreOptions
5558
// - https://docs.docker.com/engine/reference/commandline/login/#credentials-store
5659
// - https://docs.docker.com/engine/reference/commandline/cli/#docker-cli-configuration-file-configjson-properties
5760
//
58-
// Deprecated: This function is deprecated.
59-
// The same functionality is now provided by oras-go.
61+
// Deprecated: This funciton now simply calls [credentials.NewStore] of oras-go.
62+
//
63+
// [credentials.NewStore]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewStore
6064
func NewStore(configPath string, opts StoreOptions) (*DynamicStore, error) {
6165
return orascreds.NewStore(configPath, opts)
6266
}
@@ -72,8 +76,9 @@ func NewStore(configPath string, opts StoreOptions) (*DynamicStore, error) {
7276
// - https://docs.docker.com/engine/reference/commandline/cli/#configuration-files
7377
// - https://docs.docker.com/engine/reference/commandline/cli/#change-the-docker-directory
7478
//
75-
// Deprecated: This function is deprecated.
76-
// The same functionality is now provided by oras-go.
79+
// Deprecated: This funciton now simply calls [credentials.NewStoreFromDocker] of oras-go.
80+
//
81+
// [credentials.NewStoreFromDocker]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewStoreFromDocker
7782
func NewStoreFromDocker(opts StoreOptions) (*DynamicStore, error) {
7883
return orascreds.NewStoreFromDocker(opts)
7984
}
@@ -85,8 +90,9 @@ func NewStoreFromDocker(opts StoreOptions) (*DynamicStore, error) {
8590
// - Put() saves the credentials into the primary store.
8691
// - Delete() deletes the credentials from the primary store.
8792
//
88-
// Deprecated: This function is deprecated.
89-
// The same functionality is now provided by oras-go.
93+
// Deprecated: This funciton now simply calls [credentials.NewStoreWithFallbacks] of oras-go.
94+
//
95+
// [credentials.NewStoreWithFallbacks]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials#NewStoreWithFallbacks
9096
func NewStoreWithFallbacks(primary Store, fallbacks ...Store) Store {
9197
return orascreds.NewStoreWithFallbacks(primary, fallbacks...)
9298
}

trace/trace.go

+11-12
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ limitations under the License.
1414
*/
1515

1616
// Deprecated: This package is deprecated.
17-
// The same functionality is now provided by [oras-go].
17+
// The same functionality is now provided by [oras.land/oras-go/v2/registry/remote/credentials/trace].
1818
//
19-
// [oras-go]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials/trace
19+
// [oras.land/oras-go/v2/registry/remote/credentials/trace]: https://pkg.go.dev/oras.land/oras-go/v2/registry/remote/credentials/trace
2020
package trace
2121

2222
import (
@@ -25,22 +25,20 @@ import (
2525
orastrace "oras.land/oras-go/v2/registry/remote/credentials/trace"
2626
)
2727

28-
// executableTraceContextKey is a value key used to retrieve the ExecutableTrace
29-
// from Context.
30-
type executableTraceContextKey struct{}
31-
3228
// ExecutableTrace is a set of hooks used to trace the execution of binary
3329
// executables. Any particular hook may be nil.
3430
//
35-
// Deprecated: This type is deprecated.
36-
// The same functionality is now provided by oras-go.
31+
// Deprecated: This type is now simply [trace.ExecutableTrace] of oras-go.
32+
//
33+
// [trace.ExecutableTrace]: http://localhost:6060/pkg/github.com/oras-project/oras-credentials-go/trace/#ExecutableTrace
3734
type ExecutableTrace = orastrace.ExecutableTrace
3835

3936
// ContextExecutableTrace returns the ExecutableTrace associated with the
4037
// context. If none, it returns nil.
4138
//
42-
// Deprecated: This type is deprecated.
43-
// The same functionality is now provided by oras-go.
39+
// Deprecated: This function now simply calls [trace.ContextExecutableTrace] of oras-go.
40+
//
41+
// [trace.ContextExecutableTrace]: http://localhost:6060/pkg/github.com/oras-project/oras-credentials-go/trace/#ContextExecutableTrace
4442
func ContextExecutableTrace(ctx context.Context) *ExecutableTrace {
4543
return orastrace.ContextExecutableTrace(ctx)
4644
}
@@ -50,8 +48,9 @@ func ContextExecutableTrace(ctx context.Context) *ExecutableTrace {
5048
// previously added trace, the hooks defined in the new trace will be added
5149
// in addition to the previous ones. The recent hooks will be called first.
5250
//
53-
// Deprecated: This type is deprecated.
54-
// The same functionality is now provided by oras-go.
51+
// Deprecated: This function now simply calls [trace.WithExecutableTrace] of oras-go.
52+
//
53+
// [trace.WithExecutableTrace]: http://localhost:6060/pkg/github.com/oras-project/oras-credentials-go/trace/#WithExecutableTrace
5554
func WithExecutableTrace(ctx context.Context, trace *ExecutableTrace) context.Context {
5655
return orastrace.WithExecutableTrace(ctx, trace)
5756
}

0 commit comments

Comments
 (0)