service

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package service manages microCMS service definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	ServiceID            string    `json:"serviceId"`
	Alias                string    `json:"alias,omitempty"`
	ContentAPIBaseURL    string    `json:"contentApiBaseUrl"`
	ManagementAPIBaseURL string    `json:"managementApiBaseUrl"`
	ContentAPIKey        string    `json:"contentApiKey"`
	ManagementAPIKey     string    `json:"managementApiKey,omitempty"`
	CreatedAt            time.Time `json:"createdAt"`
	UpdatedAt            time.Time `json:"updatedAt"`
}

Service represents a registered microCMS service.

func (*Service) ContentBaseURL

func (s *Service) ContentBaseURL() string

ContentBaseURL returns the content API base URL for this service.

func (*Service) ManagementBaseURL

func (s *Service) ManagementBaseURL() string

ManagementBaseURL returns the management API base URL for this service.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store provides CRUD operations for service definitions.

func NewStore

func NewStore() *Store

NewStore creates a store using the default service directory.

func NewStoreWithDir

func NewStoreWithDir(dir string) *Store

NewStoreWithDir creates a store using a custom directory (for testing).

func (*Store) Add

func (s *Store) Add(svc *Service) error

Add registers a new service, encrypting API keys.

func (*Store) Get

func (s *Store) Get(id string) (*Service, error)

Get retrieves a service by ID.

func (*Store) GetDecrypted

func (s *Store) GetDecrypted(id string) (*Service, error)

GetDecrypted retrieves a service with decrypted API keys.

func (*Store) IDs

func (s *Store) IDs() []string

IDs returns all registered service IDs.

func (*Store) List

func (s *Store) List() ([]*Service, error)

List returns all registered services.

func (*Store) Remove

func (s *Store) Remove(id string) error

Remove deletes a service by ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL