mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-24 01:27:49 +01:00
Update commnets of exported methods and structs
This commit is contained in:
parent
2bc557b559
commit
5a5eb1d377
@ -6,18 +6,18 @@ import "time"
|
||||
|
||||
//AlternatePolicyConfiguration store the related configurations for alternate policy.
|
||||
type AlternatePolicyConfiguration struct {
|
||||
//The interval of executing attached tasks.
|
||||
//Duration is the interval of executing attached tasks.
|
||||
Duration time.Duration
|
||||
|
||||
//The execution time point of each turn
|
||||
//OffsetTime is the execution time point of each turn
|
||||
//It's a number to indicate the seconds offset to the 00:00 of UTC time.
|
||||
OffsetTime int64
|
||||
|
||||
//Time should be later than start time.
|
||||
//StartTimestamp is the time should be later than start time.
|
||||
//If set <=0 value, no limitation.
|
||||
StartTimestamp int64
|
||||
|
||||
//Time should be earlier than end time.
|
||||
//EndTimestamp is the time should be earlier than end time.
|
||||
//If set <=0 value, no limitation.
|
||||
EndTimestamp int64
|
||||
}
|
||||
|
@ -12,13 +12,13 @@ import "github.com/vmware/harbor/src/common/scheduler/task"
|
||||
//Please be aware that policy with no tasks will be treated as invalid.
|
||||
//
|
||||
type Policy interface {
|
||||
//Return the name of the policy.
|
||||
//Name will return the name of the policy.
|
||||
Name() string
|
||||
|
||||
//Return the attached tasks with this policy.
|
||||
//Tasks will return the attached tasks with this policy.
|
||||
Tasks() []task.Task
|
||||
|
||||
//Attach tasks to this policy
|
||||
//AttachTasks is to attach tasks to this policy
|
||||
AttachTasks(...task.Task) error
|
||||
|
||||
//Done will setup a channel for other components to check whether or not
|
||||
|
@ -15,7 +15,7 @@ type Store interface {
|
||||
//Get the corresponding policy with the key.
|
||||
Get(key string) *Watcher
|
||||
|
||||
//Check if the key existing in the store.
|
||||
//Exists is to check if the key existing in the store.
|
||||
Exists(key string) bool
|
||||
|
||||
//Remove the specified policy and return its reference.
|
||||
@ -24,7 +24,7 @@ type Store interface {
|
||||
//Size return the total count of items in store.
|
||||
Size() uint32
|
||||
|
||||
//Get all the items in the store.
|
||||
//GetAll is to get all the items in the store.
|
||||
GetAll() []*Watcher
|
||||
|
||||
//Clear store.
|
||||
@ -112,7 +112,7 @@ func (cs *ConcurrentStore) Size() uint32 {
|
||||
return (uint32)(len(cs.data))
|
||||
}
|
||||
|
||||
//Get all the items of store.
|
||||
//GetAll to get all the items of store.
|
||||
func (cs *ConcurrentStore) GetAll() []*Watcher {
|
||||
all := []*Watcher{}
|
||||
|
||||
|
@ -2,7 +2,7 @@ package task
|
||||
|
||||
//Task is used to synchronously run specific action(s).
|
||||
type Task interface {
|
||||
//Name of the task.
|
||||
//TaskName should return the name of the task.
|
||||
TaskName() string
|
||||
|
||||
//Run the concrete code here
|
||||
|
Loading…
Reference in New Issue
Block a user