neoneo-go/pkg/services/rpcsrv/params/params.go
Roman Khimov 43a59adbd0 rpc/server: move to services/rpcsrv
`server` is not a good package name and it's an internal service, so it can be
just about anywhere.
2022-07-21 22:14:12 +03:00

22 lines
345 B
Go

package params
import "fmt"
type (
// Params represents the JSON-RPC params.
Params []Param
)
// Value returns the param struct for the given
// index if it exists.
func (p Params) Value(index int) *Param {
if len(p) > index {
return &p[index]
}
return nil
}
func (p Params) String() string {
return fmt.Sprintf("%v", []Param(p))
}