directive

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuthProvider

func IsAuthProvider(v string) bool

func IsConnectionType

func IsConnectionType(v string) bool

func IsModelOperation

func IsModelOperation(v string) bool

Types

type AuthProvider

type AuthProvider string
const (
	APIKEY  AuthProvider = "apiKey"
	IAM     AuthProvider = "iam"
	OIDC    AuthProvider = "oidc"
	COGNITO AuthProvider = "userPools"
	LAMBDA  AuthProvider = "lambda"
)

func (AuthProvider) IsApiKey

func (a AuthProvider) IsApiKey() bool

func (AuthProvider) IsCognito

func (a AuthProvider) IsCognito() bool

func (AuthProvider) IsIam

func (a AuthProvider) IsIam() bool

func (AuthProvider) IsLambda

func (a AuthProvider) IsLambda() bool

func (AuthProvider) IsOidc

func (a AuthProvider) IsOidc() bool

type AuthProviderList

type AuthProviderList []*AuthProvider

func (AuthProviderList) Intersection

func (l AuthProviderList) Intersection(ll AuthProviderList) (lll AuthProviderList)

func (AuthProviderList) Union

type AuthRule

type AuthRule struct {
	AuthProvider    AuthProvider
	ModelOperations []ModelOperation
}

func (AuthRule) HasCreate

func (a AuthRule) HasCreate() bool

func (AuthRule) HasDelete

func (a AuthRule) HasDelete() bool

func (AuthRule) HasRead

func (a AuthRule) HasRead() bool

func (AuthRule) HasUpdate

func (a AuthRule) HasUpdate() bool

type AuthRuleBuilder

type AuthRuleBuilder struct {
	AuthProvider    AuthProvider
	ModelOperations []ModelOperation
}

func NewAuthRuleBuilder

func NewAuthRuleBuilder() *AuthRuleBuilder

func (*AuthRuleBuilder) Build

func (a *AuthRuleBuilder) Build() *AuthRule

func (*AuthRuleBuilder) SetAuthProvider

func (a *AuthRuleBuilder) SetAuthProvider(authProvider string) error

func (*AuthRuleBuilder) SetModelOperations

func (a *AuthRuleBuilder) SetModelOperations(operations []string) error

type AuthRuleList

type AuthRuleList []*AuthRule

func NewAuthRuleList

func NewAuthRuleList(d ast.Directive) *AuthRuleList

func (AuthRuleList) ForProvider

func (l AuthRuleList) ForProvider(v string) *AuthRule

func (AuthRuleList) HasApiKey

func (l AuthRuleList) HasApiKey() bool

func (AuthRuleList) HasCognito

func (l AuthRuleList) HasCognito() bool

func (AuthRuleList) HasIAM

func (l AuthRuleList) HasIAM() bool

func (AuthRuleList) HasLambda

func (l AuthRuleList) HasLambda() bool

func (AuthRuleList) HasOidc

func (l AuthRuleList) HasOidc() bool

func (AuthRuleList) ProvidersAllowedToCreate

func (l AuthRuleList) ProvidersAllowedToCreate() AuthProviderList

func (AuthRuleList) ProvidersAllowedToDelete

func (l AuthRuleList) ProvidersAllowedToDelete() AuthProviderList

func (AuthRuleList) ProvidersAllowedToRead

func (l AuthRuleList) ProvidersAllowedToRead() AuthProviderList

func (AuthRuleList) ProvidersAllowedToUpdate

func (l AuthRuleList) ProvidersAllowedToUpdate() AuthProviderList

type ConnectionType

type ConnectionType string
const (
	HasOne     ConnectionType = "hasOne"
	HasMany    ConnectionType = "hasMany"
	ManyToMany ConnectionType = "manyToMany"
)

func NewConnection

func NewConnection(name string) *ConnectionType

func (ConnectionType) IsHasMany

func (c ConnectionType) IsHasMany() bool

func (ConnectionType) IsHasOne

func (c ConnectionType) IsHasOne() bool

func (ConnectionType) IsManyToMany

func (c ConnectionType) IsManyToMany() bool

type Directive

type Directive struct {
	AuthRules      *AuthRuleList
	ConnectionType *ConnectionType
}

func NewDirective

func NewDirective(l ast.DirectiveList) *Directive

func (Directive) HasAuthRules

func (d Directive) HasAuthRules() bool

func (Directive) HasConnection

func (d Directive) HasConnection() bool

type ModelOperation

type ModelOperation string
const (
	CREATE ModelOperation = "create"
	UPDATE ModelOperation = "update"
	DELETE ModelOperation = "delete"
	READ   ModelOperation = "read"
)

Jump to

Keyboard shortcuts

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