kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/go/services/explore/explore.go (about) 1 /* 2 * Copyright 2018 The Kythe Authors. All rights reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 // Package explore defines the ExploreService interface. 18 package explore // import "kythe.io/kythe/go/services/explore" 19 20 import ( 21 "context" 22 23 epb "kythe.io/kythe/proto/explore_go_proto" 24 ) 25 26 // Service defines the interface for the ExploreService defined in kythe/proto/explore.proto. 27 type Service interface { 28 // Returns the hierarchy (supertypes and subtypes, including implementations) 29 // of a specified type, as a directed acyclic graph. 30 // NOT YET IMPLEMENTED 31 TypeHierarchy(context.Context, *epb.TypeHierarchyRequest) (*epb.TypeHierarchyReply, error) 32 33 // Returns the (recursive) callers of a specified function, as a directed 34 // graph. 35 // The Callers/Callees functions are distinct from XrefService.CrossReferences 36 // in that these functions capture the semantic relationships between methods, 37 // rather than the locations in the code base where a method is called. 38 // NOT YET IMPLEMENTED 39 Callers(context.Context, *epb.CallersRequest) (*epb.CallersReply, error) 40 41 // Returns the (recursive) callees of a specified function (that is, what 42 // functions this function calls), as a directed graph. 43 // NOT YET IMPLEMENTED 44 Callees(context.Context, *epb.CalleesRequest) (*epb.CalleesReply, error) 45 46 // Returns the parameters of a specified function. 47 // NOT YET IMPLEMENTED 48 Parameters(context.Context, *epb.ParametersRequest) (*epb.ParametersReply, error) 49 50 // Returns the parents of a specified node 51 // (for example, the file for a class, or the class for a function). 52 // Note that in some cases a node may have more than one parent. 53 Parents(context.Context, *epb.ParentsRequest) (*epb.ParentsReply, error) 54 55 // Returns the children of a specified node 56 // (for example, the classes contained in a file, or the functions contained in a class). 57 Children(context.Context, *epb.ChildrenRequest) (*epb.ChildrenReply, error) 58 } 59 60 // BoundedRequests guards against requests that include so many input tickets that they 61 // threaten the functioning of the service (in the absence of server-side throttling of 62 // individual requests). 63 type BoundedRequests struct { 64 MaxTickets int 65 Service 66 }