2020-07-20 15:28:48 -04:00
|
|
|
/*
|
|
|
|
* MinIO Cloud Storage, (C) 2020 MinIO, Inc.
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package dns
|
|
|
|
|
2020-09-30 17:09:41 -04:00
|
|
|
// Error - DNS related errors error.
|
|
|
|
type Error struct {
|
|
|
|
Bucket string
|
|
|
|
Err error
|
|
|
|
}
|
|
|
|
|
|
|
|
// ErrInvalidBucketName for buckets with invalid name
|
|
|
|
type ErrInvalidBucketName Error
|
|
|
|
|
|
|
|
func (e ErrInvalidBucketName) Error() string {
|
2021-04-08 11:24:55 -04:00
|
|
|
return e.Bucket + " invalid bucket name error: " + e.Err.Error()
|
2020-09-30 17:09:41 -04:00
|
|
|
}
|
2021-04-08 11:24:55 -04:00
|
|
|
|
2020-09-30 17:09:41 -04:00
|
|
|
func (e Error) Error() string {
|
|
|
|
return "dns related error: " + e.Err.Error()
|
|
|
|
}
|
|
|
|
|
2021-04-08 11:24:55 -04:00
|
|
|
// ErrBucketConflict for buckets that already exist
|
|
|
|
type ErrBucketConflict Error
|
|
|
|
|
|
|
|
func (e ErrBucketConflict) Error() string {
|
|
|
|
return e.Bucket + " bucket conflict error: " + e.Err.Error()
|
|
|
|
}
|
|
|
|
|
2020-07-20 15:28:48 -04:00
|
|
|
// Store dns record store
|
|
|
|
type Store interface {
|
|
|
|
Put(bucket string) error
|
|
|
|
Get(bucket string) ([]SrvRecord, error)
|
|
|
|
Delete(bucket string) error
|
|
|
|
List() (map[string][]SrvRecord, error)
|
|
|
|
DeleteRecord(record SrvRecord) error
|
|
|
|
Close() error
|
2020-09-10 17:19:32 -04:00
|
|
|
String() string
|
2020-07-20 15:28:48 -04:00
|
|
|
}
|