You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mirror.go 736B

123456789101112131415161718192021222324
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package convert
  4. import (
  5. repo_model "code.gitea.io/gitea/models/repo"
  6. api "code.gitea.io/gitea/modules/structs"
  7. )
  8. // ToPushMirror convert from repo_model.PushMirror and remoteAddress to api.TopicResponse
  9. func ToPushMirror(pm *repo_model.PushMirror) (*api.PushMirror, error) {
  10. repo := pm.GetRepository()
  11. return &api.PushMirror{
  12. RepoName: repo.Name,
  13. RemoteName: pm.RemoteName,
  14. RemoteAddress: pm.RemoteAddress,
  15. CreatedUnix: pm.CreatedUnix.FormatLong(),
  16. LastUpdateUnix: pm.LastUpdateUnix.FormatLong(),
  17. LastError: pm.LastError,
  18. Interval: pm.Interval.String(),
  19. SyncOnCommit: pm.SyncOnCommit,
  20. }, nil
  21. }