@@ -94,11 +94,11 @@ type ContextTLSData struct {
9494
9595// New creates a store from a given directory.
9696// If the directory does not exist or is empty, initialize it
97- func New (dir string , cfg Config ) Store {
97+ func New (dir string , cfg Config ) * ContextStore {
9898 metaRoot := filepath .Join (dir , metadataDir )
9999 tlsRoot := filepath .Join (dir , tlsDir )
100100
101- return & store {
101+ return & ContextStore {
102102 meta : & metadataStore {
103103 root : metaRoot ,
104104 config : cfg ,
@@ -109,12 +109,12 @@ func New(dir string, cfg Config) Store {
109109 }
110110}
111111
112- type store struct {
112+ type ContextStore struct {
113113 meta * metadataStore
114114 tls * tlsStore
115115}
116116
117- func (s * store ) List () ([]Metadata , error ) {
117+ func (s * ContextStore ) List () ([]Metadata , error ) {
118118 return s .meta .list ()
119119}
120120
@@ -131,22 +131,22 @@ func Names(s Lister) ([]string, error) {
131131 return names , nil
132132}
133133
134- func (s * store ) CreateOrUpdate (meta Metadata ) error {
134+ func (s * ContextStore ) CreateOrUpdate (meta Metadata ) error {
135135 return s .meta .createOrUpdate (meta )
136136}
137137
138- func (s * store ) Remove (name string ) error {
138+ func (s * ContextStore ) Remove (name string ) error {
139139 if err := s .meta .remove (name ); err != nil {
140140 return err
141141 }
142142 return s .tls .removeAllContextData (name )
143143}
144144
145- func (s * store ) GetMetadata (name string ) (Metadata , error ) {
145+ func (s * ContextStore ) GetMetadata (name string ) (Metadata , error ) {
146146 return s .meta .get (name )
147147}
148148
149- func (s * store ) ResetTLSMaterial (name string , data * ContextTLSData ) error {
149+ func (s * ContextStore ) ResetTLSMaterial (name string , data * ContextTLSData ) error {
150150 if err := s .tls .removeAllContextData (name ); err != nil {
151151 return err
152152 }
@@ -163,7 +163,7 @@ func (s *store) ResetTLSMaterial(name string, data *ContextTLSData) error {
163163 return nil
164164}
165165
166- func (s * store ) ResetEndpointTLSMaterial (contextName string , endpointName string , data * EndpointTLSData ) error {
166+ func (s * ContextStore ) ResetEndpointTLSMaterial (contextName string , endpointName string , data * EndpointTLSData ) error {
167167 if err := s .tls .removeAllEndpointData (contextName , endpointName ); err != nil {
168168 return err
169169 }
@@ -178,23 +178,23 @@ func (s *store) ResetEndpointTLSMaterial(contextName string, endpointName string
178178 return nil
179179}
180180
181- func (s * store ) ListTLSFiles (name string ) (map [string ]EndpointFiles , error ) {
181+ func (s * ContextStore ) ListTLSFiles (name string ) (map [string ]EndpointFiles , error ) {
182182 res , err := s .tls .listContextData (name )
183183 if err != nil {
184184 return res , errors .Wrapf (err , "failed to list TLS files for context %s" , name )
185185 }
186186 return res , nil
187187}
188188
189- func (s * store ) GetTLSData (contextName , endpointName , fileName string ) ([]byte , error ) {
189+ func (s * ContextStore ) GetTLSData (contextName , endpointName , fileName string ) ([]byte , error ) {
190190 res , err := s .tls .getData (contextName , endpointName , fileName )
191191 if err != nil {
192192 return res , errors .Wrapf (err , "failed to read TLS data for context %s" , contextName )
193193 }
194194 return res , nil
195195}
196196
197- func (s * store ) GetStorageInfo (contextName string ) StorageInfo {
197+ func (s * ContextStore ) GetStorageInfo (contextName string ) StorageInfo {
198198 dir := contextdirOf (contextName )
199199 return StorageInfo {
200200 MetadataPath : s .meta .contextDir (dir ),
0 commit comments