Documentation ¶
Index ¶
Constants ¶
View Source
const (
EventSync = "sync"
)
These are all the types of events.
View Source
const SyncIntervalStopChanName = "sync_stop_chan"
Variables ¶
View Source
var SshRewriteUrlMap = make(map[string]string)
这个变量保存需要被替换的ssh地址
View Source
var SyncChan = make(chan SyncInfo, 100)
Functions ¶
Types ¶
type Commit ¶
Commit represents the commit information in a sync event. We could use git.Commit, but that would lead to an import cycle, and may anyway represent coupling (of an internal API to serialised data) that we don't want.
type Event ¶
type Event struct { // ID is a UUID for this event. Will be auto-set when saving if blank. ID EventID `json:"id"` ResourceIDs []resource.ResourceID `json:"resourceIDs"` // Type is the type of event, usually "release" for now, but could be other // things later Type string `json:"type"` // StartedAt is the time the event began. StartedAt time.Time `json:"startedAt"` // EndedAt is the time the event ended. For instantaneous events, this will // be the same as StartedAt. EndedAt time.Time `json:"endedAt"` // Metadata is Event.Type-specific metadata. If an event has no metadata, // this will be nil. Metadata EventMetadata `json:"metadata,omitempty"` }
type EventMetadata ¶
type EventMetadata interface {
Type() string
}
EventMetadata is a type safety trick used to make sure that Metadata field of Event is always a pointer, so that consumers can cast without being concerned about encountering a value type instead. It works by virtue of the fact that the method is only defined for pointer receivers; the actual method chosen is entirely arbitary.
type FileCommit ¶
type GitOps ¶
type GitOps struct { GitHost string `json:"gitHost,omitempty"` Envs []model.EnvParas Wg *sync.WaitGroup // contains filtered or unexported fields }
func (*GitOps) AskForSync ¶
func (*GitOps) PrepareSSHKeys ¶
func (*GitOps) SyncInterval ¶
func (g *GitOps) SyncInterval(StopCh <-chan struct{})
type ResourceCommit ¶
type ResourceError ¶
type ResourceError struct { ID resource.ResourceID `json:"id,omitempty"` Path string `json:"path,omitempty"` Error string `json:"error,omitempty"` Commit string `json:"commit,omitempty"` }
type SyncEventMetadata ¶
type SyncEventMetadata struct { Commit string `json:"commit,omitempty"` // Per-resource errors Errors []ResourceError `json:"errors,omitempty"` FileCommits []FileCommit `json:"filesCommit,omitempty"` ResourceCommits []ResourceCommit `json:"resourceCommits,omitempty"` }
SyncEventMetadata is the metadata for when new a commit is synced to the cluster
func (*SyncEventMetadata) Type ¶
func (sem *SyncEventMetadata) Type() string
Click to show internal directories.
Click to hide internal directories.