Documentation ¶
Overview ¶
Package minio_api
Index ¶
- Constants
- func NewCred(id, secret string) miniocred.Value
- type BucketConfig
- type BusinessUser
- type Client
- func (c *Client) AddIAMUser(cred *miniocred.Value) error
- func (c *Client) AtomicWorkflow(req Req) (resp Resp, err error)
- func (c *Client) BatchDeleteAccessKey()
- func (c *Client) BatchDeleteBucket()
- func (c *Client) BatchDeletePolicy()
- func (c *Client) CreateAccessKey() (miniocred.Value, error)
- func (c *Client) DeleteAccessKey(accessKeyID string) error
- func (c *Client) DeleteAccessPolicy(config *PolicyConfig) error
- func (c *Client) GC(gcFn ...util.Func)
- func (c *Client) ListAccessKey()
- func (c *Client) ListBucket()
- func (c *Client) ListCannedPolicy()
- func (c *Client) MakeBucket(bucketConfig *BucketConfig) error
- func (c *Client) RemoveBucket(bucketConfig *BucketConfig) error
- func (c *Client) RemoveIAMUser(accessKeyID string) error
- func (c *Client) SetAccessPolicy(config *PolicyConfig) error
- func (c *Client) SetBucketPolicy(policyConfig *PolicyConfig) error
- func (c *Client) TempGetObject(objectConfig *ObjectConfig, expiry time.Duration) (*url.URL, error)
- func (c *Client) TempPutObject(objectConfig *ObjectConfig, expiry time.Duration) (*url.URL, error)
- func (c *Client) UpdateBucketQuota(bucketConfig *BucketConfig) error
- func (c *Client) WithContext(ctx context.Context) *Client
- type ObjectConfig
- type PolicyConfig
- func (c *PolicyConfig) IBAPAccessKeyWithOneBucketObjectCRUDPolicy() (string, error)
- func (c *PolicyConfig) RBAPBucketWithAccessKeyOneBucketObjectCRUDStatement() s3apiv2.Statement
- func (c *PolicyConfig) RBAPBucketWithAdminAllStatement() s3apiv2.Statement
- func (c *PolicyConfig) RBAPBucketWithAdminAllWithAccessKeyOneBucketObjectCRUDPolicy() (string, error)
- type Req
- type Resp
Constants ¶
const ( IAMIBAP = "IBAP" IAMRBAP = "RBAP" IdentifyAdmin = "Admin" IdentifyAccessKey = "AccessKey" OneBucketObjectCRUD = "WithOneBucketObjectCRUD" )
const ( AccessKeyIDMaxLen = 50 SecretAccessKeyMaxLen = 128 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BucketConfig ¶
type BucketConfig struct { // username to make bucket BusinessUser BusinessUser // restrict bucket Quota size: /Byte Quota uint64 // bucket name to get, delete, update BucketName string }
type BusinessUser ¶
BusinessUser assume the business user is
type Client ¶
type Client struct { Endpoint string miniocred.Value Secure bool // contains filtered or unexported fields }
func (*Client) AddIAMUser ¶ added in v1.1.1
func (*Client) AtomicWorkflow ¶ added in v1.1.1
AtomicWorkflow functionality:
- create a bucket, set bucket quota by byte{BucketQuotaByte} with optional bucket name{BucketName}
- create an iam credential{AccessKeyID, SecretAccessKey}
- set bucket RBAPolicy, with info(2): Principal{AccessKeyID}, with info(1): Resource{BucketName, BucketName/*}, Action{CRUD}
- iam user policy (1). create an IAM IBAPolicy, with info(1): Resource{BucketName, BucketName/*}, with Action{CRUD} (2). attach policy with info(4) to info(2)
- return Result of all sensitive info(1,2,3,4,5)
atomicity:
- when any of 1,2,3,4,5 failed, rollback all, return error
- when all of 1,2,3,4,5 success, return Resp
synchronization 1. the func call may take some time and may be failure with nothing created in Minio Server so call to with go func() { resp, err := minioClient.AtomicWorkflow() } or use channel is a good practice
func (*Client) BatchDeleteAccessKey ¶ added in v1.1.4
func (c *Client) BatchDeleteAccessKey()
func (*Client) BatchDeleteBucket ¶ added in v1.1.4
func (c *Client) BatchDeleteBucket()
func (*Client) BatchDeletePolicy ¶ added in v1.1.4
func (c *Client) BatchDeletePolicy()
func (*Client) DeleteAccessKey ¶
func (*Client) DeleteAccessPolicy ¶
func (c *Client) DeleteAccessPolicy(config *PolicyConfig) error
DeleteAccessPolicy 1. detach the PolicyJSONString from an exists user 1. delete the PolicyJSONString from Minio Server(Minio IAM)
func (*Client) GC ¶ added in v1.1.4
GC garbage collection of resource that allocated: 1. Object 2. Bucket 3. AccessKey 4. IBAPolicy
func (*Client) ListAccessKey ¶ added in v1.1.4
func (c *Client) ListAccessKey()
func (*Client) ListBucket ¶ added in v1.1.4
func (c *Client) ListBucket()
func (*Client) ListCannedPolicy ¶ added in v1.1.4
func (c *Client) ListCannedPolicy()
func (*Client) MakeBucket ¶
func (c *Client) MakeBucket(bucketConfig *BucketConfig) error
MakeBucket 1. make a new bucket 2. set bucket quota: size(B) 3. set bucket access policy
func (*Client) RemoveBucket ¶
func (c *Client) RemoveBucket(bucketConfig *BucketConfig) error
func (*Client) RemoveIAMUser ¶ added in v1.1.1
func (*Client) SetAccessPolicy ¶ added in v1.1.1
func (c *Client) SetAccessPolicy(config *PolicyConfig) error
SetAccessPolicy 1. create an IBA AccessKey Policy(IAM Policy) from business user information 2. and attach the created policy to the business user's AccessKey
func (*Client) SetBucketPolicy ¶ added in v1.1.1
func (c *Client) SetBucketPolicy(policyConfig *PolicyConfig) error
func (*Client) TempGetObject ¶ added in v1.1.3
func (*Client) TempPutObject ¶ added in v1.1.3
func (*Client) UpdateBucketQuota ¶
func (c *Client) UpdateBucketQuota(bucketConfig *BucketConfig) error
type ObjectConfig ¶ added in v1.1.3
type ObjectConfig struct { // +required BucketName string // +optional ObjectPath string // +required ObjectName string }
func (*ObjectConfig) ObjectAbsName ¶ added in v1.1.3
func (c *ObjectConfig) ObjectAbsName() string
func (*ObjectConfig) ObjectAbsPath ¶ added in v1.1.3
func (c *ObjectConfig) ObjectAbsPath() string
type PolicyConfig ¶
type PolicyConfig struct { // +required BusinessUser BusinessUser // Minio's UserName equals to Minio's AccessKeyID // +required Cred.AccessKeyID Cred miniocred.Value // +optional GroupName string // +required BucketName string // when delete policy from a user, must provide the PolicyName // +required // when create policy from a user, api will ignore the PolicyName // +optional PolicyName string }
func (*PolicyConfig) IBAPAccessKeyWithOneBucketObjectCRUDPolicy ¶
func (c *PolicyConfig) IBAPAccessKeyWithOneBucketObjectCRUDPolicy() (string, error)
func (*PolicyConfig) RBAPBucketWithAccessKeyOneBucketObjectCRUDStatement ¶
func (c *PolicyConfig) RBAPBucketWithAccessKeyOneBucketObjectCRUDStatement() s3apiv2.Statement
func (*PolicyConfig) RBAPBucketWithAdminAllStatement ¶
func (c *PolicyConfig) RBAPBucketWithAdminAllStatement() s3apiv2.Statement
func (*PolicyConfig) RBAPBucketWithAdminAllWithAccessKeyOneBucketObjectCRUDPolicy ¶
func (c *PolicyConfig) RBAPBucketWithAdminAllWithAccessKeyOneBucketObjectCRUDPolicy() (string, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package minio_inst/client.go was generated by codegen, please fix its package dependency, but do not modify its functionality
|
Package minio_inst/client.go was generated by codegen, please fix its package dependency, but do not modify its functionality |