github.com/searKing/golang/go@v1.2.74/container/stream/op/terminal/sink.go (about) 1 // Copyright 2020 The searKing Author. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package terminal 6 7 import ( 8 "github.com/searKing/golang/go/util/function/consumer/sink" 9 "github.com/searKing/golang/go/util/function/supplier" 10 "github.com/searKing/golang/go/util/optional" 11 ) 12 13 /** 14 * A {@link Sink} which accumulates state as elements are accepted, and allows 15 * a result to be retrieved after the computation is finished. 16 * 17 * @param <T> the type of elements to be accepted 18 * @param <R> the type of the result 19 * 20 * @since 1.8 21 */ 22 type Sink interface { 23 sink.Sink 24 supplier.OptionalSupplier 25 } 26 27 type TODOSink struct { 28 sink.TODO 29 } 30 31 func (sink *TODOSink) Get() optional.Optional { 32 return optional.Empty() 33 }