parser

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Package string
	// Scopes is list of scopes defined for the service.
	Scopes []Scope
	// Methods is mapping between full method name and its scopes.
	Methods []Method
}

File represents a proto file with all OAuth2 information parsed. Scopes and methods are converted from map to sorted slice of struct to have determinate generated codes.

func ParseFile

func ParseFile(file *descriptorpb.FileDescriptorProto) (*File, error)

ParseFile parsed the given proto file to extract its OAuth2 scopes information.

type Method

type Method struct {
	Name   string
	Scopes []string
}

Method represents a gRPC method and its OAuth2 scopes.

type Scope

type Scope struct {
	Name  string
	Value string
}

Scope represents an OAuth2 scope.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL