internal

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Platform SDK
	BasePath    = "api/v1"
	APITimeout  = time.Second * 30
	TokenMaxAge = int64((time.Hour * 23) / time.Millisecond)
	// Message Queue
	MQSendTimeout    = time.Millisecond * 5000
	MQReceiveTimeout = time.Millisecond * 5000

	SDKVersion = "1.1.0"
)

Shared SDK Constants

Variables

View Source
var Environments = []string{"sandbox", "integration", "production"}

Environments are Rize infrastructure tiers

View Source
var MQServices = []string{"adjustments", "customer", "debit_card", "synthetic_account", "transfer", "transaction"}

MQServices are the available Message Queue topic services

Functions

func BuildSchemaPathsList added in v1.1.0

func BuildSchemaPathsList() []string

BuildSchemaPathsList generates a list of all path and method combinations in the OpenAPI schema

func CheckEnvVariable

func CheckEnvVariable(key string) string

CheckEnvVariable is a helper function to check for the existence of an environment variable

func Difference

func Difference(a, b []string) []string

Difference will find any string from a[] that are not present in b[]

func EnableLogging

func EnableLogging(enabled bool)

EnableLogging will customize or disable the standard Go log package

func FindRoute added in v1.1.0

func FindRoute(req *http.Request) (string, error)

FindRoute matches an HTTP request with the path/operation in the OpenAPI schema

func GetRequestKeys

func GetRequestKeys(method string, path string, status int) ([]string, error)

GetRequestKeys returns any request keys (query string or body params) from the OpenAPI schema

func JSONKeys

func JSONKeys(data map[string]interface{}) []string

JSONKeys will extract key values from a JSON object

func RecurseRequestKeys

func RecurseRequestKeys(method string, path string, status int) ([]string, error)

RecurseRequestKeys recursively traverses the Request object for a given OpenAPI path and returns a list of all properties

func RecurseResponseKeys

func RecurseResponseKeys(method string, path string, status int) ([]string, error)

RecurseResponseKeys recursively traverses the Response object for a given OpenAPI path and returns a list of all properties

func ValidateRequest

func ValidateRequest(method string, path string, params url.Values, body io.Reader) (*openapi3filter.RequestValidationInput, error)

ValidateRequest is used to validate the given input according to the loaded OpenAPIv3 spec

func ValidateResponse

func ValidateResponse(status int, body []byte, requestValidationInput *openapi3filter.RequestValidationInput) error

ValidateResponse is used to validate the given input according to the loaded OpenAPIv3 spec

Types

type CustomerProfileResponseItem

type CustomerProfileResponseItem struct {
	Response string `json:"-,omitempty"`
	Num0     string `json:"0,omitempty"`
	Num1     string `json:"1,omitempty"`
	Num2     string `json:"2,omitempty"`
}

CustomerProfileResponseItem contains the Customer's response to the Profile Requirement. Use `Response` to return a string value, or Num0/1/2 for an ordered list

func (CustomerProfileResponseItem) MarshalJSON

func (c CustomerProfileResponseItem) MarshalJSON() ([]byte, error)

MarshalJSON is a custom json marshaller for CustomerProfileResponseItem

func (*CustomerProfileResponseItem) UnmarshalJSON

func (c *CustomerProfileResponseItem) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom json unmarshaller for CustomerProfileResponseItem

type DOB

type DOB time.Time

DOB is a custom date of birth time format

func (DOB) MarshalJSON

func (d DOB) MarshalJSON() ([]byte, error)

MarshalJSON is a custom json marshaller for formatting DOB strings

func (*DOB) UnmarshalJSON

func (d *DOB) UnmarshalJSON(b []byte) error

UnmarshalJSON is a custom json unmarshaller for formatting DOB strings

Jump to

Keyboard shortcuts

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