namespaces

package
v0.0.0-...-63319d1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0, Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RequestOpts golangsdk.RequestOpts = golangsdk.RequestOpts{
	MoreHeaders: map[string]string{"Content-Type": "application/json"},
}

Functions

This section is empty.

Types

type Access

type Access struct {
	// ID of the access
	ID int `json:"id"`
	// Name of the Namespace
	Name string `json:"name"`
	// Creator Name of the Namespace
	CreatorName string `json:"creator_name"`
	// Permission of current user
	SelfAuth User `json:"self_auth"`
	// Permission of other users
	OthersAuths []User `json:"others_auths"`
}

type CreateAccessOpts

type CreateAccessOpts struct {
	Users []User
}

CreateAccessOpts contains all the values needed to create access of a namespace

func (CreateAccessOpts) ToAccessCreateMap

func (opts CreateAccessOpts) ToAccessCreateMap() (map[string]interface{}, error)

ToAccessCreateMap builds a create request body from CreateAccessOpts.

type CreateAccessOptsBuilder

type CreateAccessOptsBuilder interface {
	ToAccessCreateMap() (map[string]interface{}, error)
}

CreateAccessOptsBuilder allows extensions to add additional parameters to the create request.

type CreateAccessResult

type CreateAccessResult struct {
	golangsdk.ErrResult
}

func CreateAccess

func CreateAccess(c *golangsdk.ServiceClient, opts CreateAccessOptsBuilder, namespace string) (r CreateAccessResult)

CreateAccess accepts a CreateAccessOpts struct and uses the values to create access of a namespace.

type CreateOpts

type CreateOpts struct {
	Namespace string `json:"namespace" required:"true"`
}

CreateOpts contains all the values needed to create a new network

func (CreateOpts) ToNamespaceCreateMap

func (opts CreateOpts) ToNamespaceCreateMap() (map[string]interface{}, error)

ToNamespaceCreateMap builds a create request body from CreateOpts.

type CreateOptsBuilder

type CreateOptsBuilder interface {
	ToNamespaceCreateMap() (map[string]interface{}, error)
}

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	golangsdk.ErrResult
}

CreateResult represents the result of a create operation.

func Create

func Create(c *golangsdk.ServiceClient, opts CreateOptsBuilder) (r CreateResult)

Create accepts a CreateOpts struct and uses the values to create a new namespace.

type DeleteAccessResult

type DeleteAccessResult struct {
	golangsdk.ErrResult
}

func DeleteAccess

func DeleteAccess(c *golangsdk.ServiceClient, userIDs []string, namespace string) (r DeleteAccessResult)

Delete will permanently delete the access of a namespace.

type DeleteResult

type DeleteResult struct {
	golangsdk.ErrResult
}

DeleteResult represents the result of a delete operation. Call its ExtractErr method to determine if the request succeeded or failed.

func Delete

func Delete(c *golangsdk.ServiceClient, id string) (r DeleteResult)

Delete will permanently delete a particular network based on its unique ID.

type GetAccessResult

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

func GetAccess

func GetAccess(c *golangsdk.ServiceClient, namespace string) (r GetAccessResult)

Get retrieves the access of a namespace.

func (GetAccessResult) Extract

func (r GetAccessResult) Extract() (*Access, error)

type GetResult

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

GetResult represents the result of a get operation. Call its Extract method to interpret it as a Network.

func Get

func Get(c *golangsdk.ServiceClient, id string) (r GetResult)

Get retrieves a particular network based on its unique ID.

func (GetResult) Extract

func (r GetResult) Extract() (*Namespace, error)

Extract is a function that accepts a result and extracts a namespace.

type Namespace

type Namespace struct {
	// Name of the Namespace
	Name string `json:"name"`
	// Creator Name of the Namespace
	CreatorName string `json:"creator_name"`
	// Auth permission of the Namespace
	Auth int `json:"auth"`
}

type User

type User struct {
	// ID of the user
	UserID string `json:"user_id" required:"true"`
	// Name of the user
	UserName string `json:"user_name" required:"true"`
	// Permission of the user, 7: Manage. 3: Write. 1: Read
	Auth int `json:"auth" required:"true"`
}

Access information of a user

Jump to

Keyboard shortcuts

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