| // 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. |
| |
| // Package internal provides a VDL specification for a service used in the |
| // unittest of the access package. |
| package internal |
| |
| // Any package can define tags (of arbitrary types) to be attached to methods. |
| // This type can be used to index into a Permissions. |
| type MyTag string |
| |
| const ( |
| // For this example/unittest, there are three possible values of MyTag, each |
| // represented by a single-character string. |
| Read = MyTag("R") |
| Write = MyTag("W") |
| Execute = MyTag("X") |
| ) |
| |
| // MyObject demonstrates how tags are attached to methods. |
| type MyObject interface { |
| Get() error {Read} |
| Put() error {Write} |
| Resolve() error {Execute} |
| NoTags() error // No tags attached to this. |
| } |