group

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateConfig = &request.Config{
	Action:   "POST",
	Resource: "groups",
}
View Source
var GetConfig = &request.Config{
	Action:   "GET",
	Resource: "groups/:group_id",
	Headers: map[string]string{
		"Content-Type": "application/json",
	},
}
View Source
var ListConfig = &request.Config{
	Action:   "GET",
	Resource: "groups",
}

Functions

func Search(client client.Client, keyword string) (*[]Group, error)

Types

type CreateRequest

type CreateRequest struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Description string `json:"description"`
	Visibility  string `json:"visibility"` // private, internal, public, default: private
}

type CreateResponse

type CreateResponse = Group

func Create

func Create(client client.Client, req *CreateRequest) (*CreateResponse, error)

type GetRequest

type GetRequest struct {
	GroupID int64 `json:"group_id"`
}

type GetResponse

type GetResponse = Group

func Get

func Get(client client.Client, cfg *GetRequest) (*GetResponse, error)

type Group

type Group struct {

	//
	ID          int64     `json:"id"`
	Name        string    `json:"name"`
	Path        string    `json:"path"`
	Description string    `json:"description"`
	WebURL      string    `json:"web_url"`
	FullName    string    `json:"full_name"`
	FullPath    string    `json:"full_path"`
	CreatedAt   time.Time `json:"created_at"`
	ParentID    int64     `json:"parent_id"`
	//
	Visibility                     string `json:"visibility"` // internal, public, internal_only
	ShareWithGroupLock             bool   `json:"share_with_group_lock"`
	RequireTwoFactorAuthentication bool   `json:"require_two_factor_authentication"`
	TwoFactorGracePeriod           int    `json:"two_factor_grace_period"`
	ProjectCreationLevel           string `json:"project_creation_level"` // owner, developer, reporter, guest
	AutoDevOpsEnabled              bool   `json:"auto_devops_enabled"`
	SubgroupCreationLevel          string `json:"subgroup_creation_level"` // owner, developer, reporter, guest
	EmailsDisabled                 bool   `json:"emails_disabled"`
	MentionsDisabled               bool   `json:"mentions_disabled"`
	LFSEnabled                     bool   `json:"lfs_enabled"`
	DefaultBranchProtection        int    `json:"default_branch_protection"` // 0, 1, 2
	AvatarURL                      string `json:"avatar_url"`
	RequestAccessEnabled           bool   `json:"request_access_enabled"`
	LDAPCN                         string `json:"ldap_cn"`
	LDAPAccess                     string `json:"ldap_access"`
	// contains filtered or unexported fields
}

func (*Group) Get

func (g *Group) Get(cfg *GetRequest) (*Group, error)

func (*Group) List

func (g *Group) List(cfg *ListRequest) (*[]Group, error)

func (*Group) Search

func (g *Group) Search(keyword string) (*[]Group, error)

type GroupImpl

type GroupImpl interface {
	List(cfg *ListRequest) (*[]Group, error)
	Get(cfg *GetRequest) (*Group, error)
	Search(keyword string) (*[]Group, error)
}

func New

func New(client client.Client) GroupImpl

type ListRequest

type ListRequest struct {
	Search string `json:"search"`
}

type ListResponse

type ListResponse = []Group

func List

func List(client client.Client, cfg *ListRequest) (*ListResponse, error)

Jump to

Keyboard shortcuts

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