MCPcopy Create free account
hub / github.com/bufbuild/buf / newCommitKey

Function newCommitKey

private/bufpkg/bufmodule/commit_key.go:97–116  ·  view source on GitHub ↗
(
	registry string,
	commitID uuid.UUID,
	digestType DigestType,
)

Source from the content-addressed store, hash-verified

95}
96
97func newCommitKey(
98 registry string,
99 commitID uuid.UUID,
100 digestType DigestType,
101) (*commitKey, error) {
102 if registry == "" {
103 return nil, errors.New("empty registry when constructing CommitKey")
104 }
105 if commitID == uuid.Nil {
106 return nil, errors.New("empty commitID when constructing CommitKey")
107 }
108 if _, ok := digestTypeToString[digestType]; !ok {
109 return nil, fmt.Errorf("unknown DigestType when constructing CommitKey: %v", digestType)
110 }
111 return &commitKey{
112 registry: registry,
113 commitID: commitID,
114 digestType: digestType,
115 }, nil
116}
117
118func (m *commitKey) Registry() string {
119 return m.registry

Callers 2

ModuleKeyToCommitKeyFunction · 0.85
NewCommitKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…