github.com/erda-project/erda-infra@v1.0.9/providers/component-protocol/components/filter/operation.go (about) 1 // Copyright (c) 2021 Terminus, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package filter 16 17 import ( 18 "github.com/erda-project/erda-infra/providers/component-protocol/cptype" 19 ) 20 21 type ( 22 // OpFilter . 23 OpFilter struct { 24 cptype.Operation 25 ClientData OpFilterClientData `json:"clientData,omitempty"` 26 } 27 28 // OpFilterClientData . 29 OpFilterClientData struct { 30 Values cptype.ExtraMap `json:"values,omitempty"` 31 } 32 ) 33 34 // OpKey . 35 func (o OpFilter) OpKey() cptype.OperationKey { return "filter" } 36 37 type ( 38 // OpFilterItemSave . 39 OpFilterItemSave struct { 40 cptype.Operation 41 ClientData OpFilterItemSaveClientData `json:"clientData,omitempty"` 42 } 43 44 // OpFilterItemSaveClientData . 45 OpFilterItemSaveClientData struct { 46 Values cptype.ExtraMap `json:"values,omitempty"` 47 Label string `json:"label,omitempty"` 48 } 49 ) 50 51 // OpKey . 52 func (o OpFilterItemSave) OpKey() cptype.OperationKey { return "saveFilterSet" } 53 54 type ( 55 // OpFilterItemDelete . 56 OpFilterItemDelete struct { 57 cptype.Operation 58 ClientData OpFilterItemDeleteClientData `json:"clientData,omitempty"` 59 } 60 61 // OpFilterItemDeleteClientData . 62 OpFilterItemDeleteClientData struct { 63 DataRef *SetItem `json:"dataRef,omitempty"` 64 } 65 ) 66 67 // OpKey . 68 func (o OpFilterItemDelete) OpKey() cptype.OperationKey { return "deleteFilterSet" }