client

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a simple example client. While this client would normally be responsible for communicating with an upstream. API, for this demo the client is only working with in-memory data.

func NewClient

func NewClient() *Client

func (*Client) GetGroup

func (c *Client) GetGroup(ctx context.Context, groupID string) (*Group, error)

GetGroup returns the group requested if it exists, else returns an error.

func (*Client) GetProject

func (c *Client) GetProject(ctx context.Context, projectID string) (*Project, error)

GetProject returns the project requested if it exists, else returns an error.

func (*Client) GetRole

func (c *Client) GetRole(ctx context.Context, roleID string) (*Role, error)

GetRole returns the role requested if it exists, else returns an error.

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, userID string) (*User, error)

GetUser returns the user requested if it exists, else returns an error.

func (*Client) ListGroups

func (c *Client) ListGroups(ctx context.Context) ([]*Group, error)

ListGroups returns all the groups from the database.

func (*Client) ListProjects

func (c *Client) ListProjects(ctx context.Context) ([]*Project, error)

ListProjects returns all the projects from the database.

func (*Client) ListRoles

func (c *Client) ListRoles(ctx context.Context) ([]*Role, error)

ListRoles returns all the roles from the database.

func (*Client) ListUsers

func (c *Client) ListUsers(ctx context.Context) ([]*User, error)

ListUsers returns all the users from the database.

type Group

type Group struct {
	Id      string
	Name    string
	Admins  []string
	Members []string
}

type Project

type Project struct {
	Id               string
	Name             string
	Owner            string
	GroupAssignments []string
}

type Role

type Role struct {
	Id                string
	Name              string
	DirectAssignments []string
	GroupAssignments  []string
}

type User

type User struct {
	Id    string
	Name  string
	Email string
}

Jump to

Keyboard shortcuts

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