github.com/cobalt77/jfrog-client-go@v0.14.5/artifactory/services/utils/replication.go (about)

     1  package utils
     2  
     3  type ReplicationBody struct {
     4  	Username               string `json:"username"`
     5  	Password               string `json:"password"`
     6  	URL                    string `json:"url"`
     7  	CronExp                string `json:"cronExp"`
     8  	RepoKey                string `json:"repoKey"`
     9  	EnableEventReplication bool   `json:"enableEventReplication"`
    10  	SocketTimeoutMillis    int    `json:"socketTimeoutMillis"`
    11  	Enabled                bool   `json:"enabled"`
    12  	SyncDeletes            bool   `json:"syncDeletes"`
    13  	SyncProperties         bool   `json:"syncProperties"`
    14  	SyncStatistics         bool   `json:"syncStatistics"`
    15  	PathPrefix             string `json:"pathPrefix"`
    16  }
    17  
    18  type ReplicationParams struct {
    19  	Username string
    20  	Password string
    21  	Url      string
    22  	CronExp  string
    23  	// Source replication repository.
    24  	RepoKey                string
    25  	EnableEventReplication bool
    26  	SocketTimeoutMillis    int
    27  	Enabled                bool
    28  	SyncDeletes            bool
    29  	SyncProperties         bool
    30  	SyncStatistics         bool
    31  	PathPrefix             string
    32  }
    33  
    34  func CreateReplicationBody(params ReplicationParams) *ReplicationBody {
    35  	return &ReplicationBody{
    36  		Username:               params.Username,
    37  		Password:               params.Password,
    38  		URL:                    params.Url,
    39  		CronExp:                params.CronExp,
    40  		RepoKey:                params.RepoKey,
    41  		EnableEventReplication: params.EnableEventReplication,
    42  		SocketTimeoutMillis:    params.SocketTimeoutMillis,
    43  		Enabled:                params.Enabled,
    44  		SyncDeletes:            params.SyncDeletes,
    45  		SyncProperties:         params.SyncProperties,
    46  		SyncStatistics:         params.SyncStatistics,
    47  		PathPrefix:             params.PathPrefix,
    48  	}
    49  }