MCPcopy Create free account
hub / github.com/git-bug/git-bug / newVersion

Function newVersion

entities/identity/version.go:54–76  ·  view source on GitHub ↗
(repo repository.RepoClock, name string, email string, login string, avatarURL string, keys []*Key)

Source from the content-addressed store, hash-verified

52}
53
54func newVersion(repo repository.RepoClock, name string, email string, login string, avatarURL string, keys []*Key) (*version, error) {
55 clocks, err := repo.AllClocks()
56 if err != nil {
57 return nil, err
58 }
59
60 times := make(map[string]lamport.Time)
61 for name, clock := range clocks {
62 times[name] = clock.Time()
63 }
64
65 return &version{
66 id: entity.UnsetId,
67 name: name,
68 email: email,
69 login: login,
70 avatarURL: avatarURL,
71 times: times,
72 unixTime: time.Now().Unix(),
73 keys: keys,
74 nonce: makeNonce(20),
75 }, nil
76}
77
78type versionJSON struct {
79 // Additional field to version the data

Callers 3

TestVersionJSONFunction · 0.85
NewIdentityFullFunction · 0.85
MutateMethod · 0.85

Calls 3

makeNonceFunction · 0.70
AllClocksMethod · 0.65
TimeMethod · 0.65

Tested by 1

TestVersionJSONFunction · 0.68