Documentation
¶
Index ¶
- type MinioS3Client
- func (minioS3Client *MinioS3Client) AddPoliciesToUser(accessKey string, policies []string) error
- func (minioS3Client *MinioS3Client) AddServiceAccountForUser(name string, accessKey string, secretKey string) error
- func (minioS3Client *MinioS3Client) BucketExists(name string) (bool, error)
- func (minioS3Client *MinioS3Client) CheckUserCredentialsValid(name string, accessKey string, secretKey string) (bool, error)
- func (minioS3Client *MinioS3Client) CreateBucket(name string) error
- func (minioS3Client *MinioS3Client) CreateOrUpdatePolicy(name string, content string) error
- func (minioS3Client *MinioS3Client) CreatePath(bucketname string, path string) error
- func (minioS3Client *MinioS3Client) CreateUser(accessKey string, secretKey string) error
- func (minioS3Client *MinioS3Client) DeleteBucket(name string) error
- func (minioS3Client *MinioS3Client) DeletePath(bucketname string, path string) error
- func (minioS3Client *MinioS3Client) DeletePolicy(name string) error
- func (minioS3Client *MinioS3Client) DeleteUser(accessKey string) error
- func (minioS3Client *MinioS3Client) GetConfig() *s3client.S3Config
- func (minioS3Client *MinioS3Client) GetPolicyInfo(name string) (*madmin.PolicyInfo, error)
- func (minioS3Client *MinioS3Client) GetQuota(name string) (int64, error)
- func (minioS3Client *MinioS3Client) GetUserPolicies(accessKey string) ([]string, error)
- func (minioS3Client *MinioS3Client) ListBuckets() ([]string, error)
- func (minioS3Client *MinioS3Client) PathExists(bucketname string, path string) (bool, error)
- func (minioS3Client *MinioS3Client) PolicyExist(name string) (bool, error)
- func (minioS3Client *MinioS3Client) RemovePoliciesFromUser(accessKey string, policies []string) error
- func (minioS3Client *MinioS3Client) SetQuota(name string, quota int64) error
- func (minioS3Client *MinioS3Client) UserExist(accessKey string) (bool, error)
- type MockedS3Client
- func (mockedS3Provider *MockedS3Client) AddPoliciesToUser(username string, policies []string) error
- func (mockedS3Provider *MockedS3Client) AddServiceAccountForUser(name string, accessKey string, secretKey string) error
- func (mockedS3Provider *MockedS3Client) BucketExists(name string) (bool, error)
- func (mockedS3Provider *MockedS3Client) CheckUserCredentialsValid(name string, accessKey string, secretKey string) (bool, error)
- func (mockedS3Provider *MockedS3Client) CreateBucket(name string) error
- func (mockedS3Provider *MockedS3Client) CreateOrUpdatePolicy(name string, content string) error
- func (mockedS3Provider *MockedS3Client) CreatePath(bucketname string, path string) error
- func (mockedS3Provider *MockedS3Client) CreateUser(name string, password string) error
- func (mockedS3Provider *MockedS3Client) DeleteBucket(name string) error
- func (mockedS3Provider *MockedS3Client) DeletePath(bucketname string, path string) error
- func (mockedS3Provider *MockedS3Client) DeletePolicy(name string) error
- func (mockedS3Provider *MockedS3Client) DeleteUser(name string) error
- func (mockedS3Provider *MockedS3Client) GetConfig() *s3client.S3Config
- func (mockedS3Provider *MockedS3Client) GetPolicyInfo(name string) (*madmin.PolicyInfo, error)
- func (mockedS3Provider *MockedS3Client) GetQuota(name string) (int64, error)
- func (mockedS3Provider *MockedS3Client) GetUserPolicies(name string) ([]string, error)
- func (mockedS3Provider *MockedS3Client) ListBuckets() ([]string, error)
- func (mockedS3Provider *MockedS3Client) PathExists(bucketname string, path string) (bool, error)
- func (mockedS3Provider *MockedS3Client) PolicyExist(name string) (bool, error)
- func (mockedS3Provider *MockedS3Client) RemovePoliciesFromUser(username string, policies []string) error
- func (mockedS3Provider *MockedS3Client) SetQuota(name string, quota int64) error
- func (mockedS3Provider *MockedS3Client) UserExist(name string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MinioS3Client ¶
type MinioS3Client struct {
// contains filtered or unexported fields
}
func NewMinioS3Client ¶
func NewMinioS3Client(S3Config *s3client.S3Config) (*MinioS3Client, error)
func (*MinioS3Client) AddPoliciesToUser ¶
func (minioS3Client *MinioS3Client) AddPoliciesToUser(accessKey string, policies []string) error
func (*MinioS3Client) AddServiceAccountForUser ¶
func (minioS3Client *MinioS3Client) AddServiceAccountForUser( name string, accessKey string, secretKey string, ) error
func (*MinioS3Client) BucketExists ¶
func (minioS3Client *MinioS3Client) BucketExists(name string) (bool, error)
////////////////// Bucket methods // //////////////////
func (*MinioS3Client) CheckUserCredentialsValid ¶
func (*MinioS3Client) CreateBucket ¶
func (minioS3Client *MinioS3Client) CreateBucket(name string) error
func (*MinioS3Client) CreateOrUpdatePolicy ¶
func (minioS3Client *MinioS3Client) CreateOrUpdatePolicy(name string, content string) error
The AddCannedPolicy of the madmin client actually does both creation and update (so does the CLI, as both are wired to the same endpoint on Minio API server).
func (*MinioS3Client) CreatePath ¶
func (minioS3Client *MinioS3Client) CreatePath(bucketname string, path string) error
func (*MinioS3Client) CreateUser ¶
func (minioS3Client *MinioS3Client) CreateUser(accessKey string, secretKey string) error
func (*MinioS3Client) DeleteBucket ¶
func (minioS3Client *MinioS3Client) DeleteBucket(name string) error
Will fail if bucket is not empty
func (*MinioS3Client) DeletePath ¶
func (minioS3Client *MinioS3Client) DeletePath(bucketname string, path string) error
func (*MinioS3Client) DeletePolicy ¶
func (minioS3Client *MinioS3Client) DeletePolicy(name string) error
func (*MinioS3Client) DeleteUser ¶
func (minioS3Client *MinioS3Client) DeleteUser(accessKey string) error
func (*MinioS3Client) GetConfig ¶
func (minioS3Client *MinioS3Client) GetConfig() *s3client.S3Config
func (*MinioS3Client) GetPolicyInfo ¶
func (minioS3Client *MinioS3Client) GetPolicyInfo(name string) (*madmin.PolicyInfo, error)
No method exposed by the madmin client is truly satisfying to test the existence of a policy
- InfoCannedPolicyV2 returns an error if the policy does not exist (as opposed to BucketExists, for instance, see https://github.com/minio/minio-go/blob/v7.0.52/api-stat.go#L43-L45)
- ListCannedPolicyV2 is extremely slow to run when the minio instance holds a large number of policies ( ~10000 => ~50s execution time on a modest staging minio cluster)
For lack of a better solution, we use InfoCannedPolicyV2 and test the error code to identify the case of a missing policy (vs a technical, non-recoverable error in contacting the S3 server for instance) A consequence is that we do things a little differently compared to buckets - instead of just testing for existence, we get the whole policy info, and the controller uses it down the line.
func (*MinioS3Client) GetQuota ¶
func (minioS3Client *MinioS3Client) GetQuota(name string) (int64, error)
///////////////// Quota methods // /////////////////
func (*MinioS3Client) GetUserPolicies ¶
func (minioS3Client *MinioS3Client) GetUserPolicies(accessKey string) ([]string, error)
func (*MinioS3Client) ListBuckets ¶
func (minioS3Client *MinioS3Client) ListBuckets() ([]string, error)
func (*MinioS3Client) PathExists ¶
func (minioS3Client *MinioS3Client) PathExists(bucketname string, path string) (bool, error)
func (*MinioS3Client) PolicyExist ¶
func (minioS3Client *MinioS3Client) PolicyExist(name string) (bool, error)
func (*MinioS3Client) RemovePoliciesFromUser ¶
func (minioS3Client *MinioS3Client) RemovePoliciesFromUser( accessKey string, policies []string, ) error
type MockedS3Client ¶
type MockedS3Client struct {
// contains filtered or unexported fields
}
func NewMockedS3Client ¶
func NewMockedS3Client() *MockedS3Client
func (*MockedS3Client) AddPoliciesToUser ¶
func (mockedS3Provider *MockedS3Client) AddPoliciesToUser(username string, policies []string) error
func (*MockedS3Client) AddServiceAccountForUser ¶
func (mockedS3Provider *MockedS3Client) AddServiceAccountForUser(name string, accessKey string, secretKey string) error
func (*MockedS3Client) BucketExists ¶
func (mockedS3Provider *MockedS3Client) BucketExists(name string) (bool, error)
func (*MockedS3Client) CheckUserCredentialsValid ¶
func (*MockedS3Client) CreateBucket ¶
func (mockedS3Provider *MockedS3Client) CreateBucket(name string) error
func (*MockedS3Client) CreateOrUpdatePolicy ¶
func (mockedS3Provider *MockedS3Client) CreateOrUpdatePolicy(name string, content string) error
func (*MockedS3Client) CreatePath ¶
func (mockedS3Provider *MockedS3Client) CreatePath(bucketname string, path string) error
func (*MockedS3Client) CreateUser ¶
func (mockedS3Provider *MockedS3Client) CreateUser(name string, password string) error
func (*MockedS3Client) DeleteBucket ¶
func (mockedS3Provider *MockedS3Client) DeleteBucket(name string) error
func (*MockedS3Client) DeletePath ¶
func (mockedS3Provider *MockedS3Client) DeletePath(bucketname string, path string) error
func (*MockedS3Client) DeletePolicy ¶
func (mockedS3Provider *MockedS3Client) DeletePolicy(name string) error
func (*MockedS3Client) DeleteUser ¶
func (mockedS3Provider *MockedS3Client) DeleteUser(name string) error
func (*MockedS3Client) GetConfig ¶
func (mockedS3Provider *MockedS3Client) GetConfig() *s3client.S3Config
func (*MockedS3Client) GetPolicyInfo ¶
func (mockedS3Provider *MockedS3Client) GetPolicyInfo(name string) (*madmin.PolicyInfo, error)
func (*MockedS3Client) GetQuota ¶
func (mockedS3Provider *MockedS3Client) GetQuota(name string) (int64, error)
func (*MockedS3Client) GetUserPolicies ¶
func (mockedS3Provider *MockedS3Client) GetUserPolicies(name string) ([]string, error)
func (*MockedS3Client) ListBuckets ¶
func (mockedS3Provider *MockedS3Client) ListBuckets() ([]string, error)
func (*MockedS3Client) PathExists ¶
func (mockedS3Provider *MockedS3Client) PathExists(bucketname string, path string) (bool, error)
func (*MockedS3Client) PolicyExist ¶
func (mockedS3Provider *MockedS3Client) PolicyExist(name string) (bool, error)
func (*MockedS3Client) RemovePoliciesFromUser ¶
func (mockedS3Provider *MockedS3Client) RemovePoliciesFromUser(username string, policies []string) error