blob: e5ae7175c2b134d44761e98a0e98b2351940b774 [file] [log] [blame]
// 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 (
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
Granter GranterHandle
type RpcResponse struct {
OutArgs []any
TraceResponse vtrace.Response
type GranterHandle int32
type GranterRequest struct {
GranterHandle GranterHandle
Call server.SecurityCall
type GranterResponse struct {
Blessings principal.BlessingsHandle
Err error