client

package module
v2.0.0-...-94d1c0a Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MarshalFailed = errors.New("marshal failed")
)

Functions

func BasicAuthor

func BasicAuthor(username, password string) grpc.UnaryClientInterceptor

Types

type AuthType

type AuthType = string
const Basic AuthType = "Basic"
const Noop AuthType = "Noop"

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(op Options) *Client

func (Client) AddPolicies

func (c Client) AddPolicies(ctx context.Context, namespace, sec, ptype string, rules [][]string) ([][]string, error)

func (Client) Enforce

func (c Client) Enforce(ctx context.Context, namespace string, level command.EnforcePayload_Level, freshness int64, params ...interface{}) (bool, error)

func (Client) ListNamespaces

func (c Client) ListNamespaces(ctx context.Context) ([]string, error)

func (Client) ListPolicies

func (c Client) ListPolicies(ctx context.Context, namespace string) ([][]string, error)

func (Client) PrintModel

func (c Client) PrintModel(ctx context.Context, namespace string) (string, error)

func (Client) RemovePolicies

func (c Client) RemovePolicies(ctx context.Context, namespace, sec, ptype string, rules [][]string) ([][]string, error)

func (Client) ShowStats

func (c Client) ShowStats(ctx context.Context) ([]byte, error)

func (Client) UpdatePolicies

func (c Client) UpdatePolicies(ctx context.Context, namespace, sec, ptype string, old, new [][]string) (bool, error)

type Options

type Options struct {
	Target   string
	AuthType AuthType
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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