com.github.yingzhuo.spring.boot.minio.autoconfig.MinioActuatorAutoConfig Maven / Gradle / Ivy
/*
_ _ _ _ _ _ _
_ __ ___ (_)_ __ (_) ___ ___ _ __ _ __(_)_ __ __ _ | |__ ___ ___ | |_ ___| |_ __ _ _ __| |_ ___ _ __
| '_ ` _ \| | '_ \| |/ _ \ _____/ __| '_ \| '__| | '_ \ / _` |_____| '_ \ / _ \ / _ \| __|____/ __| __/ _` | '__| __/ _ \ '__|
| | | | | | | | | | | (_) |_____\__ \ |_) | | | | | | | (_| |_____| |_) | (_) | (_) | ||_____\__ \ || (_| | | | || __/ |
|_| |_| |_|_|_| |_|_|\___/ |___/ .__/|_| |_|_| |_|\__, | |_.__/ \___/ \___/ \__| |___/\__\__,_|_| \__\___|_|
|_| |___/
https://github.com/yingzhuo/minio-spring-boot-starter
*/
package com.github.yingzhuo.spring.boot.minio.autoconfig;
import com.github.yingzhuo.spring.boot.minio.actuator.MinioHealthIndicator;
import com.github.yingzhuo.spring.boot.minio.properties.MinioProperties;
import io.minio.MinioClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
/**
* @author 应卓
* @since 1.0.0
*/
@Slf4j
@ConditionalOnProperty(prefix = "minio", name = "enabled", havingValue = "true", matchIfMissing = true)
@ConditionalOnClass(name = "org.springframework.boot.actuate.endpoint.annotation.Endpoint")
@AutoConfigureAfter(MinioCoreAutoConfig.class)
class MinioActuatorAutoConfig {
@Bean
@ConditionalOnMissingBean
MinioHealthIndicator minioHealthIndicator(MinioClient client, MinioProperties properties) {
return new MinioHealthIndicator(client, properties.getBucket());
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy