util

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetApplicationDir

func GetApplicationDir() (string, error)

GetApplicationDir returns a string representation of the home path for use with configuration/data storage needs

func GetConfigPath

func GetConfigPath() (string, error)

GetConfigPath returns a string representation of the configuration's path

func GetTimestamp

func GetTimestamp() time.Time

GetTimestamp returns the timestamp in UTC for use with signature creation and event firing.

func GetVersion

func GetVersion() string

GetVersion retrieves the version number for use later in the version command and for request headers.

func InsertIntoDB

func InsertIntoDB(p EventCacheParameters) error

InsertIntoDB inserts an event into the database for replay functions later.

func RandomGUID

func RandomGUID() string

RandomGUID generates a random GUID for use with creating IDs in the local store and for mock events

func RandomUserID

func RandomUserID() string

RandomUserID generates a random user ID from 1->100,000,000 for use in mock events

func SetVersion

func SetVersion(v string)

SetVersion sets the version number for use later in the version command and for request headers.

func SetupTestEnv

func SetupTestEnv(t *testing.T) *assert.Assertions

Types

type EventCacheParameters

type EventCacheParameters struct {
	ID        string
	Event     string
	JSON      string
	FromUser  string
	ToUser    string
	Transport string
	Timestamp string
}

EventCacheParameters is used to define required parameters when writing into the database

type EventCacheResponse

type EventCacheResponse struct {
	ID        string
	Event     string
	JSON      string
	Transport string
	Timestamp string
}

EventCacheResponse is used to define the response coming from a SELECT-based function

func GetEventByID

func GetEventByID(id string) (EventCacheResponse, error)

GetEventByID returns an event based on an ID provided for replay.

Jump to

Keyboard shortcuts

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