code.vegaprotocol.io/vega@v0.79.0/core/datasource/common/interfaces.go (about) 1 // Copyright (C) 2023 Gobalsky Labs Limited 2 // 3 // This program is free software: you can redistribute it and/or modify 4 // it under the terms of the GNU Affero General Public License as 5 // published by the Free Software Foundation, either version 3 of the 6 // License, or (at your option) any later version. 7 // 8 // This program is distributed in the hope that it will be useful, 9 // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 // GNU Affero General Public License for more details. 12 // 13 // You should have received a copy of the GNU Affero General Public License 14 // along with this program. If not, see <http://www.gnu.org/licenses/>. 15 16 //lint:file-ignore ST1003 Ignore underscores in names, this is straigh copied from the proto package to ease introducing the domain types 17 18 package common 19 20 import ( 21 "time" 22 23 vegapb "code.vegaprotocol.io/vega/protos/vega" 24 ) 25 26 type DataSourceType interface { 27 String() string 28 DeepClone() DataSourceType 29 ToDefinitionProto() (*vegapb.DataSourceDefinition, error) 30 GetFilters() []*SpecFilter 31 } 32 33 type Timer interface { 34 DataSourceType 35 IsTriggered(time.Time) bool 36 GetTimeTriggers() InternalTimeTriggers 37 } 38 39 type signer interface { 40 oneOfProto() interface{} 41 DeepClone() signer 42 GetSignerType() SignerType 43 AsHex(bool) (signer, error) 44 AsString() (signer, error) 45 String() string 46 IsEmpty() bool 47 }