| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // The app package contains the struct that keeps per javascript app state and handles translating |
| // javascript requests to vanadium requests and vice versa. |
| package app |
| |
| import ( |
| "time" |
| |
| "v.io/v23/security" |
| "v.io/v23/vtrace" |
| ) |
| |
| type RpcRequest struct { |
| Name string |
| Method string |
| NumInArgs int32 |
| NumOutArgs int32 |
| IsStreaming bool |
| Deadline time.WireDeadline |
| TraceRequest vtrace.Request |
| CallOptions []RpcCallOption |
| } |
| |
| // TODO(nlacasse): It would be nice if RpcCallOption were a struct with |
| // optional types, like: |
| // |
| // type RpcCallOptions struct { |
| // AllowedServersPolicy ?[]security.BlessingPattern |
| // RetryTimeout ?time.Duration |
| // } |
| // |
| // Unfortunately, optional types are currently only supported for structs, not |
| // slices or primitive types. Once optional types are better supported, switch |
| // this to a struct with optional types. |
| |
| type RpcCallOption union { |
| AllowedServersPolicy []security.BlessingPattern |
| RetryTimeout time.Duration |
| } |
| |
| type RpcResponse struct { |
| OutArgs []any |
| TraceResponse vtrace.Response |
| } |