ast

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Node
	// contains filtered or unexported methods
}

type ActionStatement

type ActionStatement struct {
	Token       token.Token
	Action      *Identifier
	Subject     Subject
	Verb        *Identifier
	TypePattern *Identifier
	WhereClause Condition
}

func (*ActionStatement) String

func (a *ActionStatement) String() string

func (*ActionStatement) TokenLiteral

func (a *ActionStatement) TokenLiteral() string

type ArrayLiteral added in v0.2.4

type ArrayLiteral struct {
	Token token.Token
	Items []Condition
}

func (*ArrayLiteral) GetTypes added in v0.2.4

func (slf *ArrayLiteral) GetTypes() []*Identifier

func (*ArrayLiteral) String added in v0.2.4

func (slf *ArrayLiteral) String() string

func (*ArrayLiteral) TokenLiteral added in v0.2.4

func (slf *ArrayLiteral) TokenLiteral() string

type Condition

type Condition interface {
	Node

	GetTypes() []*Identifier
	// contains filtered or unexported methods
}

type ContextActionRule added in v0.2.2

type ContextActionRule struct {
	Context     *ContextStatement
	Action      *Identifier
	Subject     Subject
	Verb        *Identifier
	TypePattern *Identifier
	Where       *WhereClause
}

func (*ContextActionRule) String added in v0.2.2

func (a *ContextActionRule) String() string

type ContextCondition added in v0.2.2

type ContextCondition struct {
	Subject Subject
	Where   *WhereClause
}

func (*ContextCondition) String added in v0.2.2

func (a *ContextCondition) String() string

type ContextStatement added in v0.2.2

type ContextStatement struct {
	Token       token.Token
	Conditions  []*ContextCondition
	Verb        *Identifier
	TypePattern *Identifier
	ActionRules []*ContextActionRule
}

func (*ContextStatement) String added in v0.2.2

func (a *ContextStatement) String() string

func (*ContextStatement) TokenLiteral added in v0.2.2

func (a *ContextStatement) TokenLiteral() string

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

func (*Identifier) GetTypes

func (slf *Identifier) GetTypes() []*Identifier

func (*Identifier) String

func (slf *Identifier) String() string

func (*Identifier) TokenLiteral

func (slf *Identifier) TokenLiteral() string

type InfixCondition

type InfixCondition struct {
	Token    token.Token // the operator token, e.g. `==`
	Left     Condition
	Operator string
	Right    Condition
}

func (*InfixCondition) GetTypes

func (slf *InfixCondition) GetTypes() []*Identifier

func (*InfixCondition) String

func (slf *InfixCondition) String() string

func (*InfixCondition) TokenLiteral

func (slf *InfixCondition) TokenLiteral() string

type IntegerLiteral added in v0.2.2

type IntegerLiteral struct {
	Token token.Token
	Value int64
}

func (*IntegerLiteral) GetTypes added in v0.2.2

func (slf *IntegerLiteral) GetTypes() []*Identifier

func (*IntegerLiteral) String added in v0.2.2

func (slf *IntegerLiteral) String() string

func (*IntegerLiteral) TokenLiteral added in v0.2.2

func (slf *IntegerLiteral) TokenLiteral() string

type Node

type Node interface {
	TokenLiteral() string
	String() string
}

interfaces

type Policies

type Policies struct {
	Statements []Statement
}

concrete types

func (*Policies) String

func (p *Policies) String() string

func (*Policies) TokenLiteral

func (p *Policies) TokenLiteral() string

type Policy

type Policy interface {
	Node
	// contains filtered or unexported methods
}

type PrefixCondition

type PrefixCondition struct {
	Token    token.Token // the prefix token, e.g. `not`
	Operator string
	Right    Condition
}

func (*PrefixCondition) GetTypes

func (slf *PrefixCondition) GetTypes() []*Identifier

func (*PrefixCondition) String

func (slf *PrefixCondition) String() string

func (*PrefixCondition) TokenLiteral

func (slf *PrefixCondition) TokenLiteral() string

type Statement

type Statement interface {
	Node
	// contains filtered or unexported methods
}

type Subject

type Subject interface {
	Node
	// contains filtered or unexported methods
}

type SubjectGroup

type SubjectGroup struct {
	Token token.TokenType
	Group string
}

func (*SubjectGroup) String

func (s *SubjectGroup) String() string

func (*SubjectGroup) TokenLiteral

func (s *SubjectGroup) TokenLiteral() string

type SubjectUser

type SubjectUser struct {
	Token token.TokenType
	User  string
}

func (*SubjectUser) String

func (s *SubjectUser) String() string

func (*SubjectUser) TokenLiteral

func (s *SubjectUser) TokenLiteral() string

type TypePattern

type TypePattern struct {
	Token   token.TokenType
	Pattern string
}

func (*TypePattern) String

func (t *TypePattern) String() string

func (*TypePattern) TokenLiteral

func (t *TypePattern) TokenLiteral() string

type WhereClause

type WhereClause struct {
	Token     token.Token // the first token of the condition
	Condition Condition
}

WhereClause defines the where clause

func (*WhereClause) GetTypes

func (slf *WhereClause) GetTypes() []*Identifier

func (*WhereClause) String

func (slf *WhereClause) String() string

func (*WhereClause) TokenLiteral

func (slf *WhereClause) TokenLiteral() string

Jump to

Keyboard shortcuts

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