mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 10:57:05 +00:00
finish the first state of the vuejs todo mvc example, a simple rest api - todo: websocket and live updates between browser tabs with the same session id
Former-commit-id: 0bd859420cff87014479c44a471ec273c621c1a2
This commit is contained in:
@@ -2,8 +2,11 @@ package di
|
||||
|
||||
import "reflect"
|
||||
|
||||
// Values is a shortcut of []reflect.Value,
|
||||
// it makes easier to remove and add dependencies.
|
||||
type Values []reflect.Value
|
||||
|
||||
// NewValues returns new empty (dependencies) values.
|
||||
func NewValues() Values {
|
||||
return Values{}
|
||||
}
|
||||
@@ -30,6 +33,7 @@ func (bv Values) CloneWithFieldsOf(s interface{}) Values {
|
||||
return values
|
||||
}
|
||||
|
||||
// Len returns the length of the current "bv" values slice.
|
||||
func (bv Values) Len() int {
|
||||
return len(bv)
|
||||
}
|
||||
@@ -41,6 +45,8 @@ func (bv *Values) Add(values ...interface{}) {
|
||||
bv.AddValues(ValuesOf(values)...)
|
||||
}
|
||||
|
||||
// AddValues same as `Add` but accepts reflect.Value dependencies instead of interface{}
|
||||
// and appends them to the list if they pass some checks.
|
||||
func (bv *Values) AddValues(values ...reflect.Value) {
|
||||
for _, v := range values {
|
||||
if !goodVal(v) {
|
||||
|
||||
Reference in New Issue
Block a user