Documentation ¶
Overview ¶
Package chain convert the method of nested fields in structure to call chain function.
Copyright 2020 HenryLee. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmpty = errors.New("no method chain found")
ErrEmpty no method error
Functions ¶
This section is empty.
Types ¶
type Args ¶
type Args interface { Init(NestedStruct) error Arg(recvType reflect.Type, idx int, in reflect.Type) (reflect.Value, error) }
Args create input argument
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) Abort ¶
Abort prevents pending methods from being called. NOTE:
That this will not stop the execution chain.
type FactoryFunc ¶ added in v0.1.0
type FactoryFunc func() NestedStruct
FactoryFunc creates a new NestedStruct object
type Func ¶
Func function to execute method chain
type NestedStruct ¶
type NestedStruct interface { Next() Abort(error) IsAborted() bool // contains filtered or unexported methods }
NestedStruct nested structure carrying method chain