mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-12 11:10:35 +00:00
43a59adbd0
`server` is not a good package name and it's an internal service, so it can be just about anywhere.
22 lines
345 B
Go
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))
|
|
}
|