util

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractID

func ExtractID(name string, collection string) uint

ExtractID from resource name.

func ExtractIDs

func ExtractIDs(names []string, collection string) []interface{}

ExtractIDs from resource names.

func InterfaceSlice

func InterfaceSlice(dataSlice interface{}) []interface{}

InterfaceSlice converts any data slice to interface slice.

func ToSnakeSlice added in v0.3.1

func ToSnakeSlice(s []string) []string

ToSnakeSlice converts string slice to lowercase.

func Update added in v0.4.0

func Update(a interface{}, b interface{}, paths []string)

Update a from b by paths.

Types

type Paths added in v0.9.0

type Paths []string

Paths implements the some util functions of the update mask.

func (Paths) Append added in v0.9.0

func (ps Paths) Append(fields ...string) Paths

Append the fields to the paths.

func (Paths) Has added in v0.9.0

func (ps Paths) Has(path string) bool

Has indicates whether the path is included in the update mask.

func (Paths) Permit added in v0.9.0

func (ps Paths) Permit(fields ...string) Paths

Permit the fields in paths and returns a new paths.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL