util

package
v0.0.0-...-45cbd8e Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(slice []string, item string) bool

Contains Contains

func DateToString

func DateToString(ts *timestamp.Timestamp) string

DateToString DateToString

func Decrypt

func Decrypt(data []byte, passphrase string) ([]byte, error)

Decrypt something

func Encrypt

func Encrypt(data []byte, passphrase string) []byte

Encrypt something

func FormatTimeStamp

func FormatTimeStamp(ts *timestamp.Timestamp, layout string) string

FormatTimeStamp FormatTimeStamp

func GetHTTPBody

func GetHTTPBody(r *http.Request) ([]byte, error)

GetHTTPBody - Returns body

func GetHTTPBodyResponse

func GetHTTPBodyResponse(r *http.Response) ([]byte, error)

GetHTTPBodyResponse - Returns body

func GetPrincipal

func GetPrincipal(r *http.Request) model.Principal

GetPrincipal - Returns principal from request

func GetReplacebleKeyName

func GetReplacebleKeyName(value string) []string

GetReplacebleKeyName - Retrieve variable names

func Now

func Now() *timestamp.Timestamp

Now creates a timestamp.Timestamp representing the current time.

func Time

func Time(ts *timestamp.Timestamp) time.Time

Time converts a protobuf *timestamp.Timestamp to a time.Time.

func Timestamp

func Timestamp(t time.Time) *timestamp.Timestamp

Timestamp converts a time.Time to a protobuf *timestamp.Timestamp.

func UnmarshalPayload

func UnmarshalPayload(r *http.Request, payload interface{}) error

UnmarshalPayload - Transform a raw post request into a struct

Types

This section is empty.

Jump to

Keyboard shortcuts

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