Documentation
¶
Index ¶
- Variables
- func Get[E runtime.ErrorHandler, T GetConstraints](ctx context.Context, values map[string][]string) (T, *runtime.Status)
- func GetByte[E runtime.ErrorHandler](ctx context.Context, contentLocation string, values map[string][]string) ([]byte, *runtime.Status)
- func IsStarted() bool
- func Put[E runtime.ErrorHandler, T PutConstraints](ctx context.Context, t T) (pgxsql.CommandTag, *runtime.Status)
- func PutByte[E runtime.ErrorHandler](ctx context.Context, contentLocation string, data []byte) (pgxsql.CommandTag, *runtime.Status)
- type GetConstraints
- type PutConstraints
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Uri = pkgPath
)
Functions ¶
func Get ¶
func Get[E runtime.ErrorHandler, T GetConstraints](ctx context.Context, values map[string][]string) (T, *runtime.Status)
Get - templated function to query for a set of AccessLog entries from a datastore
Example ¶
err := testStartup() if err != nil { fmt.Printf("test: ClientStartup() -> [error:%v] [started:%v]\n", err, pgxsql.IsStarted()) } else { defer pgxsql.ClientShutdown() events, status1 := Get[runtime.DebugError, []content.Entry](nil, nil) fmt.Printf("test: Get[runtime.DebugError,[]Entry](nil,nil) -> [status:%v] [events:%v]\n", status1, events) }
Output: test: Get[runtime.DebugError,[]Entry](nil,nil) -> [status:OK] [events:[{customer7 2024-04-07 08:51:51.532388 -0500 CDT 0 450ms egress new mexico 0 0 0 100 0 false 0 0 false} {customer7 2024-04-07 08:51:51.532388 -0500 CDT 0 450ms egress new mexico 0 0 0 100 0 false 0 0 false}]]
func GetByte ¶
func GetByte[E runtime.ErrorHandler](ctx context.Context, contentLocation string, values map[string][]string) ([]byte, *runtime.Status)
GetByte - templated function to query for a set of AccessLog entries from a datastore
Example ¶
err := testStartup() if err != nil { fmt.Printf("test: ClientStartup() -> [error:%v] [started:%v]\n", err, pgxsql.IsStarted()) } else { defer pgxsql.ClientShutdown() buf, status := GetByte[runtime.DebugError](nil, "", nil) fmt.Printf("test: GetByte[runtime.DebugError](nil,current,nil) -> [status:%v] [buf:%v]\n", status, string(buf)) }
Output: test: GetByte[runtime.DebugError](nil,current,nil) -> [status:OK] [buf:[{"CustomerId":"customer7","StartTime":"2024-04-07T08:51:51.532388-05:00","Duration":0,"DurationString":"450ms","Traffic":"egress","Region":"new mexico","Zone":"","SubZone":"","Service":"","InstanceId":"","RouteName":"","RequestId":"","Url":"","Protocol":"","Method":"","Host":"","Path":"","StatusCode":0,"BytesSent":0,"StatusFlags":"","Timeout":0,"RateLimit":100,"RateBurst":0,"Retry":false,"RetryRateLimit":0,"RetryRateBurst":0,"Failover":false},{"CustomerId":"customer7","StartTime":"2024-04-07T08:51:51.532388-05:00","Duration":0,"DurationString":"450ms","Traffic":"egress","Region":"new mexico","Zone":"","SubZone":"","Service":"","InstanceId":"","RouteName":"","RequestId":"","Url":"","Protocol":"","Method":"","Host":"","Path":"","StatusCode":0,"BytesSent":0,"StatusFlags":"","Timeout":0,"RateLimit":100,"RateBurst":0,"Retry":false,"RetryRateLimit":0,"RetryRateBurst":0,"Failover":false}]]
func Put ¶
func Put[E runtime.ErrorHandler, T PutConstraints](ctx context.Context, t T) (pgxsql.CommandTag, *runtime.Status)
Put - templated function to Put a set of log entries into a datastore
Example ¶
err := testStartup() if err != nil { fmt.Printf("test: ClientStartup() -> [error:%v] [started:%v]\n", err, pgxsql.IsStarted()) } else { defer pgxsql.ClientShutdown() events := []content.Entry{event, event2} tag, status := Put[runtime.DebugError, []content.Entry](nil, events) fmt.Printf("test: Put[runtime.DebugError,[]Entry](nil,events) -> [status:%v] [result:%v]\n", status, tag) //body := &httptest.ReaderCloser{Reader: bytes.NewReader(buf), Err: nil} //req, _ := http.NewRequest("", "www.google.com", body) //status = Put[runtime.DebugError, *http.Request](nil, RscId, req) //fmt.Printf("test: Put(nil,[]byte) -> [status:%v]\n", status) }
Output: test: Put[runtime.DebugError,[]Entry](nil,events) -> [status:OK] [result:{INSERT 0 2 2 true false false false}]
func PutByte ¶
func PutByte[E runtime.ErrorHandler](ctx context.Context, contentLocation string, data []byte) (pgxsql.CommandTag, *runtime.Status)
PutByte - templated function to Put a set of log entries into a datastore
Example ¶
err := testStartup() if err != nil { fmt.Printf("test: ClientStartup() -> [error:%v] [started:%v]\n", err, pgxsql.IsStarted()) } else { defer pgxsql.ClientShutdown() events := []content.Entry{event, event2} buf, _ := json.Marshal(&events) tag, status := PutByte[runtime.DebugError](nil, "", buf) fmt.Printf("test: PutByte[runtime.DebugError](nil,VersionCurrent,buf) -> [status:%v] [result:%v]\n", status, tag) }
Output: test: PutByte[runtime.DebugError](nil,VersionCurrent,buf) -> [status:OK] [result:{INSERT 0 2 2 true false false false}]
Types ¶
type GetConstraints ¶
GetConstraints - interface defining constraints for the Get function
Click to show internal directories.
Click to hide internal directories.