Documentation ¶
Index ¶
Constants ¶
View Source
const ( DiffMode_CREATE diffMode = "C+" DiffMode_MODIFY diffMode = "M~" DiffMode_DELETE diffMode = "D-" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Renderer ¶
type Renderer interface { // RenderingDiffs display the diffs and make a decision to control the synchronization // should go on or abort now. RenderingDiffs(diffs []Diff1) (d Decide, reason string) // RenderingResult display the result of synchronization. RenderingResult(results []*SynchronizeResult) }
Renderer declares the display component which display some information.
type SynchronizeMode ¶
type SynchronizeMode uint8
const ( SynchronizeMode_UNKNOWN SynchronizeMode = iota SynchronizeMode_UPLOAD SynchronizeMode_DOWNLOAD )
type SynchronizeResult ¶
type SynchronizeScope ¶
type SynchronizeScope struct { Mode SynchronizeMode // Path is the parent directory which holds all downloaded remote. // apollo.appId will be used as a subdirectory. [DOWNLOAD REQUIRED] Path string // LocalFiles represents the absolute file path of local files. [UPLOAD ONLY] LocalFiles []string ApolloSecret string ApolloAppID string ApolloEnv string ApolloClusterName string ApolloPortalAddr string ApolloAccount string // ApolloAutoPublish indicates whether publish changes after uploaded // to apollo namespaces, it's disabled by default. ApolloAutoPublish bool // Overwrite indicates whether asy update the target while it exists. Overwrite bool // Force indicates whether to create the target while it not exists. Force bool // Render is an optional field which is used to render the process // and result of synchronization. Render Renderer }
SynchronizeScope represents the context of Synchronizer.Synchronize.
func (SynchronizeScope) Valid ¶
func (sc SynchronizeScope) Valid() error
type Synchronizer ¶
type Synchronizer interface {
Synchronize(ctx context.Context) ([]*SynchronizeResult, error)
}
Synchronizer 's duty is synchronizing between remote apollo portal and local filesystem.
func NewSynchronizer ¶
func NewSynchronizer(scope *SynchronizeScope) (Synchronizer, error)
Click to show internal directories.
Click to hide internal directories.