go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/common/tsmon/store/fake.go (about) 1 // Copyright 2016 The LUCI Authors. 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 store 16 17 import ( 18 "context" 19 "time" 20 21 "go.chromium.org/luci/common/tsmon/types" 22 ) 23 24 // Fake is a fake Store. 25 type Fake struct { 26 Cells []types.Cell 27 DT types.Target 28 } 29 30 // DefaultTarget returns DT. 31 func (s *Fake) DefaultTarget() types.Target { return s.DT } 32 33 // SetDefaultTarget does nothing. 34 func (s *Fake) SetDefaultTarget(types.Target) {} 35 36 // Get does nothing. 37 func (s *Fake) Get(context.Context, types.Metric, time.Time, []any) any { 38 return nil 39 } 40 41 // Set does nothing. 42 func (s *Fake) Set(context.Context, types.Metric, time.Time, []any, any) { 43 } 44 45 // Del does nothing. 46 func (s *Fake) Del(context.Context, types.Metric, []any) { 47 } 48 49 // Incr does nothing. 50 func (s *Fake) Incr(context.Context, types.Metric, time.Time, []any, any) { 51 } 52 53 // GetAll returns the pre-set list of cells. 54 func (s *Fake) GetAll(context.Context) []types.Cell { return s.Cells } 55 56 // Reset does nothing. 57 func (s *Fake) Reset(context.Context, types.Metric) {}