models

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Kind    string      `json:"kind"`
	Pattern string      `json:"pattern"` // deprecated, use Value instead
	Value   interface{} `json:"value"`
}

Filter is the data model represents the filter defined by user.

func (*Filter) Valid

func (f *Filter) Valid(v *validation.Validation)

Valid ...

type FilterConfig

type FilterConfig struct {
	// The pattern for fuzzy matching
	Pattern string
}

FilterConfig is data model to provide configurations to the filters.

type FilterItem

type FilterItem struct {

	// The kind of the filtering resources. Support 'project','repository' and 'tag' etc.
	Kind string `json:"kind"`

	// The key value of resource which can be used to filter out the resource matched with specified pattern.
	// E.g:
	// kind == 'project', value will be project name;
	// kind == 'repository', value will be repository name
	// kind == 'tag', value will be tag name.
	Value string `json:"value"`

	Operation string `json:"operation"`

	// Extension placeholder.
	// To append more additional information if required by the filter.
	Metadata map[string]interface{} `json:"metadata"`
}

FilterItem is the general data model represents the filtering resources which are used as input and output for the filters.

type Namespace

type Namespace struct {
	// Name of the namespace
	Name string

	// Extensions to provide flexibility
	Metadata map[string]interface{}
}

Namespace is the resource group/scope like project in Harbor and organization in docker hub.

type QueryParameter

type QueryParameter struct {
	// Query by page, couple with pageSize
	Page int64

	// Size of each page, couple with page
	PageSize int64

	// Query by project ID
	ProjectID int64

	// Query by name
	Name string
}

QueryParameter defines the parameters used to do query selection.

type ReplicationPolicy

type ReplicationPolicy struct {
	ID                int64 // UUID of the policy
	Name              string
	Description       string
	Filters           []Filter
	ReplicateDeletion bool
	Trigger           *Trigger // The trigger of the replication
	ProjectIDs        []int64  // Projects attached to this policy
	TargetIDs         []int64
	Namespaces        []string // The namespaces are used to set immediate trigger
	CreationTime      time.Time
	UpdateTime        time.Time
}

ReplicationPolicy defines the structure of a replication policy.

type ReplicationPolicyQueryResult

type ReplicationPolicyQueryResult struct {
	Total    int64
	Policies []*ReplicationPolicy
}

ReplicationPolicyQueryResult is the query result of replication policy

type Repository

type Repository struct {
	// Name of the repository
	Name string

	// Project reference of this repository belongs to
	Namespace Namespace

	// Extensions to provide flexibility
	Metadata map[string]interface{}
}

Repository is to keep the info of image repository.

type ScheduleParam

type ScheduleParam struct {
	Type    string `json:"type"`    // daily or weekly
	Weekday int8   `json:"weekday"` // Optional, only used when type is 'weekly'
	Offtime int64  `json:"offtime"` // The time offset with the UTC 00:00 in seconds
}

ScheduleParam defines the parameters used by schedule trigger

func (*ScheduleParam) Equal

func (s *ScheduleParam) Equal(param *ScheduleParam) bool

Equal ...

func (*ScheduleParam) Valid

func (s *ScheduleParam) Valid(v *validation.Validation)

Valid ...

type Tag

type Tag struct {
	// Name of the tag
	Name string

	// The repository reference of this tag belongs to
	Repository Repository

	// Extensions to provide flexibility
	Metadata map[string]interface{}
}

Tag keeps the info of image with specified version

type Trigger

type Trigger struct {
	Kind          string         `json:"kind"`           // the type of the trigger
	ScheduleParam *ScheduleParam `json:"schedule_param"` // optional, only used when kind is 'schedule'
}

Trigger is replication launching approach definition

func (*Trigger) Valid

func (t *Trigger) Valid(v *validation.Validation)

Valid ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL