gate

package
v0.12.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 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 {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL string, opts ...ClientOption) (*Client, error)

func (*Client) AddUserToGroup

func (c *Client) AddUserToGroup(ctx context.Context, groupID, userID int) (*http.Response, error)

func (*Client) ListGroups

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

func (*Client) RemoveUserFromGroup

func (c *Client) RemoveUserFromGroup(ctx context.Context, groupID, userID int) (*http.Response, error)

type ClientOption

type ClientOption func(*options)

func WithAPIKey

func WithAPIKey(token string) ClientOption

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

func WithQueryParamAuthMethod

func WithQueryParamAuthMethod() ClientOption

type Group

type Group struct {
	ID          int     `json:"id"`
	Name        string  `json:"name"`
	GID         int     `json:"gid"`
	CreatedAt   string  `json:"created_at"`
	UpdatedAt   string  `json:"updated_at"`
	DeletedBy   string  `json:"deleted_by"`
	DeletedAt   string  `json:"deleted_at"`
	Description *string `json:"description"`
}

type ListGroupsRequest

type ListGroupsRequest struct {
	Page    int
	PerPage int
}

Jump to

Keyboard shortcuts

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