internal

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenClient

func GenClient(resources []Resource, outputDir, outputFileName, packageName string, clientName string, interfaceName string, resourceImportPath string)

func GenResource

func GenResource(rsc Resource, outputDir, packageName string)

func GenTypes added in v0.1.1

func GenTypes(resources []Resource, outputDir, outputFileName, packageName string, interfaceName string, resourceImportPath string)

Types

type Caveat

type Caveat struct {
	Name string
	Args map[string]string // arg name to arg type
}

type Relation

type Relation struct {
	Name       string
	OutputName string
	Kind       string
	// ResourceTypes to enforce
	AllowedSubjectTypes         map[string]string
	OverrideAllowedSubjectTypes map[string]string
	// Used for resolving allowed subject types if not given in a metatag
	RelationRefs []RelationRef
}

type RelationRef

type RelationRef struct {
	ResourceType string // i.e. team#members -> team
	Relation     string // i.e. team#members -> member
	Caveat       string // key to caveat in schema
}

type Resource

type Resource struct {
	Name             string
	Permissions      map[string]Relation
	PermissionsArray []Relation
	Relations        map[string]Relation
	RelationsArray   []Relation

	// Either a specific resource type or "Resource"
	PermissionSubjectType string
	// Either a specific resource type or "Resource"
	RelationSubjectType string
}

type Schema

type Schema struct {
	Resources map[string]Resource
	Caveats   map[string]Caveat
}

func BuildSchema

func BuildSchema(compiledSchema *compiler.CompiledSchema) Schema

Jump to

Keyboard shortcuts

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