NETTİM
← Kod Sonuçlarına Dön
Go PostgreSQL SQL sorguları Fonksiyonlar Dosya işlemleri Görsel işlemleri Veri dönüştürme Ağ işlemleri Sistem yönetimi Sınıflar Lisans: Belirtilmemis

Go — installer.go

Go PostgreSQL entegrasyonlu — SQL sorguları, Fonksiyonlar, Dosya işlemleri. Fonksiyonlar: WriteInstaller, base64Encode, humanSize. SQL sorgusu içerir.
Sınırlı Önizleme Politikası: Bu kodun açık kaynak lisansı doğrulanamadığı için telif kuralları gereği yalnızca kısa önizlemesi gösterilmektedir. Tam kod için orijinal kaynağa gidin ↗.
cmd/plgo/installer.go • Go
package main

import (
	"bytes"
	"encoding/base64"
	"fmt"
	"os"
	"path/filepath"
	"text/template"
)

// installerVersion is embedded in generated scripts for diagnostics.
const installerVersion = "0.1"

// installerShellTemplate is the shell script header that gets prepended to the
// base64 payload. It is a text/template with the following variables:
//   - .ExtensionName  — the PostgreSQL extension name (e.g. "myext")
//   - .Version        — the extension version string (e.g. "0.1")
var installerShellTemplate = template.Must(template.New("installer").Parse(`#!/bin/sh
# Self-contained installer for the "{{.ExtensionName}}" PostgreSQL extension.
# Generated by plgo — https://gitlab.com/microo8/plgo
#
# Usage:
#   sudo ./install-{{.ExtensionName}}.sh [OPTIONS]
#
# Options:
#   --create-extension   After installing files, run CREATE EXTENSION via psql
#   --db DATABASE        Database for CREATE EXTENSION (default: postgres)
#   --pg-config PATH     Path to pg_config (default: auto-detect)
#   --uninstall          Remove the extension files and optionally DROP EXTENSION
#   --dry-run            Show what would be done without changing anything
#   --help               Show this help message
#
# Environment:
#   PG_CONFIG            Same as --pg-config
#   PGDATABASE           Same as --db

Tespit Edilen SQL Sorguları

with the following variables:
with line wrapping at 76 chars
with all base64 decoders).

Benzer Kod Örnekleri

Go — modulewriter.go
Go • SQL sorguları
Go — installer_test.go
Go • SQL sorguları
Go — functions.go
Go • SQL sorguları
Go — channel_example_test.go
Go • Fonksiyonlar