iam

package
v0.110.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: Apache-2.0 Imports: 8 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 {
	HTTPClient  *http.Client
	URL         string
	Credentials credentials.Credentials
}

Client service

func New

func New(url string, creds credentials.Credentials, timeout time.Duration) Client

func (*Client) GetUser

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

Get user data

type Group

type Group struct {
	ID string `json:"id"`
}

Group represents the group that the user belongs to

type Organization

type Organization struct {
	ID string `json:"id"`
}

Organization represents the organization that the user belongs to

type Service

type Service interface {
	GetUser(context.Context) (User, error)
}

type User

type User struct {
	ID           string       `json:"id"`
	Groups       []Group      `json:"groups"`
	Organization Organization `json:"organization"`
}

User represents user data structure

Jump to

Keyboard shortcuts

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