utils

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(bashPath, path string) string

Abs Use bashPath as the working directory to return the absolute path

func BasePath

func BasePath() string

BasePath return executable file directory

func BytesToString

func BytesToString(b []byte) string

BytesToString converts byte slice to string.

func MD5String

func MD5String(val string) (result string)

func MatchName

func MatchName(val string) bool

MatchName if match user name return true

func MatchPassword

func MatchPassword(val string) bool

MatchPassword if match passsword name return true

func NewGateway

func NewGateway() *runtime.ServeMux

func StringToBytes

func StringToBytes(s string) []byte

StringToBytes converts string to byte slice.

Types

type HTTPBodyMarshaler

type HTTPBodyMarshaler struct {
	runtime.Marshaler
}

HTTPBodyMarshaler is a Marshaler which supports marshaling of a google.api.HttpBody message as the full response body if it is the actual message used as the response. If not, then this will simply fallback to the Marshaler specified as its default Marshaler.

func (*HTTPBodyMarshaler) ContentType

func (h *HTTPBodyMarshaler) ContentType(v interface{}) string

ContentType returns its specified content type in case v is a google.api.HttpBody message, otherwise it will fall back to the default Marshalers content type.

func (*HTTPBodyMarshaler) Delimiter

func (h *HTTPBodyMarshaler) Delimiter() []byte

Delimiter returns the record separator for the stream.

func (*HTTPBodyMarshaler) Marshal

func (h *HTTPBodyMarshaler) Marshal(v interface{}) ([]byte, error)

Marshal marshals "v" by returning the body bytes if v is a google.api.HttpBody message, otherwise it falls back to the default Marshaler.

Jump to

Keyboard shortcuts

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