MCPcopy Create free account
hub / github.com/compozy/agh / parseNetworkExpiresAt

Function parseNetworkExpiresAt

internal/cli/network.go:2071–2086  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

2069}
2070
2071func parseNetworkExpiresAt(raw string) (*int64, error) {
2072 trimmed := strings.TrimSpace(raw)
2073 if trimmed == "" {
2074 return nil, nil
2075 }
2076 if unixSeconds, err := strconv.ParseInt(trimmed, 10, 64); err == nil {
2077 return &unixSeconds, nil
2078 }
2079
2080 parsed, err := time.Parse(time.RFC3339, trimmed)
2081 if err != nil {
2082 return nil, errors.New("cli: --expires-at must be unix seconds or RFC3339")
2083 }
2084 unixSeconds := parsed.UTC().Unix()
2085 return &unixSeconds, nil
2086}
2087
2088func networkCompactExt(ext map[string]json.RawMessage) string {
2089 if len(ext) == 0 {

Callers 1

newNetworkSendCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected